Skip to content

Commit 686f669

Browse files
committed
workqueue: move to use bus_get_dev_root()
Direct access to the struct bus_type dev_root pointer is going away soon so replace that with a call to bus_get_dev_root() instead, which is what it is there for. Cc: Lai Jiangshan <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent db281d5 commit 686f669

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kernel/workqueue.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5826,13 +5826,19 @@ static struct device_attribute wq_sysfs_cpumask_attr =
58265826

58275827
static int __init wq_sysfs_init(void)
58285828
{
5829+
struct device *dev_root;
58295830
int err;
58305831

58315832
err = subsys_virtual_register(&wq_subsys, NULL);
58325833
if (err)
58335834
return err;
58345835

5835-
return device_create_file(wq_subsys.dev_root, &wq_sysfs_cpumask_attr);
5836+
dev_root = bus_get_dev_root(&wq_subsys);
5837+
if (dev_root) {
5838+
err = device_create_file(dev_root, &wq_sysfs_cpumask_attr);
5839+
put_device(dev_root);
5840+
}
5841+
return err;
58365842
}
58375843
core_initcall(wq_sysfs_init);
58385844

0 commit comments

Comments
 (0)