Skip to content

Commit 822c790

Browse files
committed
x86/umwait: move to use bus_get_dev_root()
JIRA: https://issues.redhat.com/browse/RHEL-1023 commit 6026027 Author: Greg Kroah-Hartman <[email protected]> Date: Mon Mar 13 19:28:52 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: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: [email protected] Cc: "H. Peter Anvin" <[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 4ff0bf6 commit 822c790

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arch/x86/kernel/cpu/umwait.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ static int __init umwait_init(void)
232232
* Add umwait control interface. Ignore failure, so at least the
233233
* default values are set up in case the machine manages to boot.
234234
*/
235-
dev = cpu_subsys.dev_root;
236-
return sysfs_create_group(&dev->kobj, &umwait_attr_group);
235+
dev = bus_get_dev_root(&cpu_subsys);
236+
if (dev) {
237+
ret = sysfs_create_group(&dev->kobj, &umwait_attr_group);
238+
put_device(dev);
239+
}
240+
return ret;
237241
}
238242
device_initcall(umwait_init);

0 commit comments

Comments
 (0)