File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -1208,16 +1208,16 @@ int eeh_dev_open(struct pci_dev *pdev)
1208
1208
struct eeh_dev * edev ;
1209
1209
int ret = - ENODEV ;
1210
1210
1211
- mutex_lock (& eeh_dev_mutex );
1211
+ guard ( mutex ) (& eeh_dev_mutex );
1212
1212
1213
1213
/* No PCI device ? */
1214
1214
if (!pdev )
1215
- goto out ;
1215
+ return ret ;
1216
1216
1217
1217
/* No EEH device or PE ? */
1218
1218
edev = pci_dev_to_eeh_dev (pdev );
1219
1219
if (!edev || !edev -> pe )
1220
- goto out ;
1220
+ return ret ;
1221
1221
1222
1222
/*
1223
1223
* The PE might have been put into frozen state, but we
@@ -1227,16 +1227,12 @@ int eeh_dev_open(struct pci_dev *pdev)
1227
1227
*/
1228
1228
ret = eeh_pe_change_owner (edev -> pe );
1229
1229
if (ret )
1230
- goto out ;
1230
+ return ret ;
1231
1231
1232
1232
/* Increase PE's pass through count */
1233
1233
atomic_inc (& edev -> pe -> pass_dev_cnt );
1234
- mutex_unlock (& eeh_dev_mutex );
1235
1234
1236
1235
return 0 ;
1237
- out :
1238
- mutex_unlock (& eeh_dev_mutex );
1239
- return ret ;
1240
1236
}
1241
1237
EXPORT_SYMBOL_GPL (eeh_dev_open );
1242
1238
@@ -1252,22 +1248,20 @@ void eeh_dev_release(struct pci_dev *pdev)
1252
1248
{
1253
1249
struct eeh_dev * edev ;
1254
1250
1255
- mutex_lock (& eeh_dev_mutex );
1251
+ guard ( mutex ) (& eeh_dev_mutex );
1256
1252
1257
1253
/* No PCI device ? */
1258
1254
if (!pdev )
1259
- goto out ;
1255
+ return ;
1260
1256
1261
1257
/* No EEH device ? */
1262
1258
edev = pci_dev_to_eeh_dev (pdev );
1263
1259
if (!edev || !edev -> pe || !eeh_pe_passed (edev -> pe ))
1264
- goto out ;
1260
+ return ;
1265
1261
1266
1262
/* Decrease PE's pass through count */
1267
1263
WARN_ON (atomic_dec_if_positive (& edev -> pe -> pass_dev_cnt ) < 0 );
1268
1264
eeh_pe_change_owner (edev -> pe );
1269
- out :
1270
- mutex_unlock (& eeh_dev_mutex );
1271
1265
}
1272
1266
EXPORT_SYMBOL (eeh_dev_release );
1273
1267
You can’t perform that action at this time.
0 commit comments