File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -382,35 +382,27 @@ int cxl_dpa_free(struct cxl_endpoint_decoder *cxled)
382
382
{
383
383
struct cxl_port * port = cxled_to_port (cxled );
384
384
struct device * dev = & cxled -> cxld .dev ;
385
- int rc ;
386
385
387
- down_write (& cxl_dpa_rwsem );
388
- if (!cxled -> dpa_res ) {
389
- rc = 0 ;
390
- goto out ;
391
- }
386
+ guard (rwsem_write )(& cxl_dpa_rwsem );
387
+ if (!cxled -> dpa_res )
388
+ return 0 ;
392
389
if (cxled -> cxld .region ) {
393
390
dev_dbg (dev , "decoder assigned to: %s\n" ,
394
391
dev_name (& cxled -> cxld .region -> dev ));
395
- rc = - EBUSY ;
396
- goto out ;
392
+ return - EBUSY ;
397
393
}
398
394
if (cxled -> cxld .flags & CXL_DECODER_F_ENABLE ) {
399
395
dev_dbg (dev , "decoder enabled\n" );
400
- rc = - EBUSY ;
401
- goto out ;
396
+ return - EBUSY ;
402
397
}
403
398
if (cxled -> cxld .id != port -> hdm_end ) {
404
399
dev_dbg (dev , "expected decoder%d.%d\n" , port -> id ,
405
400
port -> hdm_end );
406
- rc = - EBUSY ;
407
- goto out ;
401
+ return - EBUSY ;
408
402
}
403
+
409
404
devm_cxl_dpa_release (cxled );
410
- rc = 0 ;
411
- out :
412
- up_write (& cxl_dpa_rwsem );
413
- return rc ;
405
+ return 0 ;
414
406
}
415
407
416
408
int cxl_dpa_set_mode (struct cxl_endpoint_decoder * cxled ,
You can’t perform that action at this time.
0 commit comments