aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 19:28:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 15:29:23 +0100
commit686f669780276da534e93ba769e02bdcf1f89f8d (patch)
treef135baadb77fcd767f462a32103d37f02889fb57 /kernel/workqueue.c
parentdb281d59e26b9aaccfd2334450099a1bc472bac6 (diff)
downloadlinux-686f669780276da534e93ba769e02bdcf1f89f8d.tar.gz
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 <jiangshanlai@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20230313182918.1312597-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index b8b541caed485..209917792fa45 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);