File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -2521,22 +2521,33 @@ static const struct attribute_group cpuhp_smt_attr_group = {
2521
2521
2522
2522
static int __init cpu_smt_sysfs_init (void )
2523
2523
{
2524
- return sysfs_create_group (& cpu_subsys .dev_root -> kobj ,
2525
- & cpuhp_smt_attr_group );
2524
+ struct device * dev_root ;
2525
+ int ret = - ENODEV ;
2526
+
2527
+ dev_root = bus_get_dev_root (& cpu_subsys );
2528
+ if (dev_root ) {
2529
+ ret = sysfs_create_group (& dev_root -> kobj , & cpuhp_smt_attr_group );
2530
+ put_device (dev_root );
2531
+ }
2532
+ return ret ;
2526
2533
}
2527
2534
2528
2535
static int __init cpuhp_sysfs_init (void )
2529
2536
{
2537
+ struct device * dev_root ;
2530
2538
int cpu , ret ;
2531
2539
2532
2540
ret = cpu_smt_sysfs_init ();
2533
2541
if (ret )
2534
2542
return ret ;
2535
2543
2536
- ret = sysfs_create_group (& cpu_subsys .dev_root -> kobj ,
2537
- & cpuhp_cpu_root_attr_group );
2538
- if (ret )
2539
- return ret ;
2544
+ dev_root = bus_get_dev_root (& cpu_subsys );
2545
+ if (dev_root ) {
2546
+ ret = sysfs_create_group (& dev_root -> kobj , & cpuhp_cpu_root_attr_group );
2547
+ put_device (dev_root );
2548
+ if (ret )
2549
+ return ret ;
2550
+ }
2540
2551
2541
2552
for_each_possible_cpu (cpu ) {
2542
2553
struct device * dev = get_cpu_device (cpu );
You can’t perform that action at this time.
0 commit comments