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.

powerpc/sysfs: 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: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: David Hildenbrand <david@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230313182918.1312597-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+12 -2
+12 -2
arch/powerpc/kernel/sysfs.c
··· 217 217 static void __init sysfs_create_dscr_default(void) 218 218 { 219 219 if (cpu_has_feature(CPU_FTR_DSCR)) { 220 + struct device *dev_root; 220 221 int cpu; 221 222 222 223 dscr_default = spr_default_dscr; 223 224 for_each_possible_cpu(cpu) 224 225 paca_ptrs[cpu]->dscr_default = dscr_default; 225 226 226 - device_create_file(cpu_subsys.dev_root, &dev_attr_dscr_default); 227 + dev_root = bus_get_dev_root(&cpu_subsys); 228 + if (dev_root) { 229 + device_create_file(dev_root, &dev_attr_dscr_default); 230 + put_device(dev_root); 231 + } 227 232 } 228 233 } 229 234 #endif /* CONFIG_PPC64 */ ··· 751 746 752 747 static void __init create_svm_file(void) 753 748 { 754 - device_create_file(cpu_subsys.dev_root, &dev_attr_svm); 749 + struct device *dev_root = bus_get_dev_root(&cpu_subsys); 750 + 751 + if (dev_root) { 752 + device_create_file(dev_root, &dev_attr_svm); 753 + put_device(dev_root); 754 + } 755 755 } 756 756 #else 757 757 static void __init create_svm_file(void)