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/powernv: 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: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Liang He <windhl@126.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Julia Lawall <Julia.Lawall@inria.fr>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230313182918.1312597-13-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+15 -4
+7 -2
arch/powerpc/platforms/powernv/idle.c
··· 1464 1464 power7_fastsleep_workaround_entry = false; 1465 1465 power7_fastsleep_workaround_exit = false; 1466 1466 } else { 1467 + struct device *dev_root; 1467 1468 /* 1468 1469 * OPAL_PM_SLEEP_ENABLED_ER1 is set. It indicates that 1469 1470 * workaround is needed to use fastsleep. Provide sysfs 1470 1471 * control to choose how this workaround has to be 1471 1472 * applied. 1472 1473 */ 1473 - device_create_file(cpu_subsys.dev_root, 1474 - &dev_attr_fastsleep_workaround_applyonce); 1474 + dev_root = bus_get_dev_root(&cpu_subsys); 1475 + if (dev_root) { 1476 + device_create_file(dev_root, 1477 + &dev_attr_fastsleep_workaround_applyonce); 1478 + put_device(dev_root); 1479 + } 1475 1480 } 1476 1481 1477 1482 update_subcore_sibling_mask();
+8 -2
arch/powerpc/platforms/powernv/subcore.c
··· 415 415 416 416 static int subcore_init(void) 417 417 { 418 + struct device *dev_root; 418 419 unsigned pvr_ver; 420 + int rc = 0; 419 421 420 422 pvr_ver = PVR_VER(mfspr(SPRN_PVR)); 421 423 ··· 437 435 438 436 set_subcores_per_core(1); 439 437 440 - return device_create_file(cpu_subsys.dev_root, 441 - &dev_attr_subcores_per_core); 438 + dev_root = bus_get_dev_root(&cpu_subsys); 439 + if (dev_root) { 440 + rc = device_create_file(dev_root, &dev_attr_subcores_per_core); 441 + put_device(dev_root); 442 + } 443 + return rc; 442 444 } 443 445 machine_device_initcall(powernv, subcore_init);