diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-13 19:28:52 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-17 15:29:29 +0100 |
commit | 60260272dc59ca0da233de5ff452859f2e981bdb (patch) | |
tree | 7c32abe335fcd46f8254bfc96ca78b4450cedcc4 /arch/x86/kernel/cpu | |
parent | 216f58beb26e683e6d437c43e6aaf8e7b8631447 (diff) | |
download | linux-stable-60260272dc59ca0da233de5ff452859f2e981bdb.tar.gz linux-stable-60260272dc59ca0da233de5ff452859f2e981bdb.tar.bz2 linux-stable-60260272dc59ca0da233de5ff452859f2e981bdb.zip |
x86/umwait: 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: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20230313182918.1312597-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r-- | arch/x86/kernel/cpu/umwait.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/umwait.c b/arch/x86/kernel/cpu/umwait.c index ec8064c0ae03..2293efd6ffa6 100644 --- a/arch/x86/kernel/cpu/umwait.c +++ b/arch/x86/kernel/cpu/umwait.c @@ -232,7 +232,11 @@ static int __init umwait_init(void) * Add umwait control interface. Ignore failure, so at least the * default values are set up in case the machine manages to boot. */ - dev = cpu_subsys.dev_root; - return sysfs_create_group(&dev->kobj, &umwait_attr_group); + dev = bus_get_dev_root(&cpu_subsys); + if (dev) { + ret = sysfs_create_group(&dev->kobj, &umwait_attr_group); + put_device(dev); + } + return ret; } device_initcall(umwait_init); |