Skip to content

Commit d4e81a6

Browse files
committed
workqueue: move to use bus_get_dev_root()
JIRA: https://issues.redhat.com/browse/RHEL-1023 commit 686f669 Author: Greg Kroah-Hartman <[email protected]> Date: Mon Mar 13 19:28:50 2023 +0100 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]> Signed-off-by: Mark Langsdorf <[email protected]>
1 parent 3b27e2e commit d4e81a6

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
@@ -5782,13 +5782,19 @@ static struct device_attribute wq_sysfs_cpumask_attr =
57825782

57835783
static int __init wq_sysfs_init(void)
57845784
{
5785+
struct device *dev_root;
57855786
int err;
57865787

57875788
err = subsys_virtual_register(&wq_subsys, NULL);
57885789
if (err)
57895790
return err;
57905791

5791-
return device_create_file(wq_subsys.dev_root, &wq_sysfs_cpumask_attr);
5792+
dev_root = bus_get_dev_root(&wq_subsys);
5793+
if (dev_root) {
5794+
err = device_create_file(dev_root, &wq_sysfs_cpumask_attr);
5795+
put_device(dev_root);
5796+
}
5797+
return err;
57925798
}
57935799
core_initcall(wq_sysfs_init);
57945800

0 commit comments

Comments
 (0)