File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -3572,9 +3572,8 @@ static void shutdown_notifiers(void *_cxlr)
3572
3572
unregister_mt_adistance_algorithm (& cxlr -> adist_notifier );
3573
3573
}
3574
3574
3575
- static int cxl_region_probe (struct device * dev )
3575
+ static int cxl_region_can_probe (struct cxl_region * cxlr )
3576
3576
{
3577
- struct cxl_region * cxlr = to_cxl_region (dev );
3578
3577
struct cxl_region_params * p = & cxlr -> params ;
3579
3578
int rc ;
3580
3579
@@ -3597,15 +3596,28 @@ static int cxl_region_probe(struct device *dev)
3597
3596
goto out ;
3598
3597
}
3599
3598
3600
- /*
3601
- * From this point on any path that changes the region's state away from
3602
- * CXL_CONFIG_COMMIT is also responsible for releasing the driver.
3603
- */
3604
3599
out :
3605
3600
up_read (& cxl_region_rwsem );
3606
3601
3607
3602
if (rc )
3608
3603
return rc ;
3604
+ return 0 ;
3605
+ }
3606
+
3607
+ static int cxl_region_probe (struct device * dev )
3608
+ {
3609
+ struct cxl_region * cxlr = to_cxl_region (dev );
3610
+ struct cxl_region_params * p = & cxlr -> params ;
3611
+ int rc ;
3612
+
3613
+ rc = cxl_region_can_probe (cxlr );
3614
+ if (rc )
3615
+ return rc ;
3616
+
3617
+ /*
3618
+ * From this point on any path that changes the region's state away from
3619
+ * CXL_CONFIG_COMMIT is also responsible for releasing the driver.
3620
+ */
3609
3621
3610
3622
cxlr -> memory_notifier .notifier_call = cxl_region_perf_attrs_callback ;
3611
3623
cxlr -> memory_notifier .priority = CXL_CALLBACK_PRI ;
You can’t perform that action at this time.
0 commit comments