From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 18:28:50 +0000 (+0100) Subject: workqueue: move to use bus_get_dev_root() X-Git-Tag: v6.6.7~2982^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=686f669780276da534e93ba769e02bdcf1f89f8d;p=platform%2Fkernel%2Flinux-starfive.git 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 Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230313182918.1312597-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b8b541c..2099177 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5826,13 +5826,19 @@ static struct device_attribute wq_sysfs_cpumask_attr = static int __init wq_sysfs_init(void) { + struct device *dev_root; int err; err = subsys_virtual_register(&wq_subsys, NULL); if (err) return err; - return device_create_file(wq_subsys.dev_root, &wq_sysfs_cpumask_attr); + dev_root = bus_get_dev_root(&wq_subsys); + if (dev_root) { + err = device_create_file(dev_root, &wq_sysfs_cpumask_attr); + put_device(dev_root); + } + return err; } core_initcall(wq_sysfs_init);