Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/microcode: 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: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
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-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+9 -4
+9 -4
arch/x86/kernel/cpu/microcode/core.c
··· 632 632 633 633 static int __init microcode_init(void) 634 634 { 635 + struct device *dev_root; 635 636 struct cpuinfo_x86 *c = &boot_cpu_data; 636 637 int error; 637 638 ··· 653 652 if (IS_ERR(microcode_pdev)) 654 653 return PTR_ERR(microcode_pdev); 655 654 656 - error = sysfs_create_group(&cpu_subsys.dev_root->kobj, &cpu_root_microcode_group); 657 - if (error) { 658 - pr_err("Error creating microcode group!\n"); 659 - goto out_pdev; 655 + dev_root = bus_get_dev_root(&cpu_subsys); 656 + if (dev_root) { 657 + error = sysfs_create_group(&dev_root->kobj, &cpu_root_microcode_group); 658 + put_device(dev_root); 659 + if (error) { 660 + pr_err("Error creating microcode group!\n"); 661 + goto out_pdev; 662 + } 660 663 } 661 664 662 665 /* Do per-CPU setup */