summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 19:29:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 15:30:03 +0100
commit31e7c4cc7da9d1b5ac01de9829aba53081b1b794 (patch)
tree1b57f700cc7edd2f6765d64aacddfa50c87632c1 /arch/s390
parent9493ed19fbc302d8e3ba487b7c99a7beeddbff96 (diff)
downloadlinux-stable-31e7c4cc7da9d1b5ac01de9829aba53081b1b794.tar.gz
linux-stable-31e7c4cc7da9d1b5ac01de9829aba53081b1b794.tar.bz2
linux-stable-31e7c4cc7da9d1b5ac01de9829aba53081b1b794.zip
s390/smp: 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: Vasily Gorbik <gor@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Ilya Leoshkevich <iii@linux.ibm.com> Cc: linux-s390@vger.kernel.org Acked-by: Heiko Carstens <hca@linux.ibm.com> Link: https://lore.kernel.org/r/20230313182918.1312597-19-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/smp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index d4888453bbf8..4df797ab8ca2 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -1227,11 +1227,17 @@ static DEVICE_ATTR_WO(rescan);
static int __init s390_smp_init(void)
{
+ struct device *dev_root;
int cpu, rc = 0;
- rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
- if (rc)
- return rc;
+ dev_root = bus_get_dev_root(&cpu_subsys);
+ if (dev_root) {
+ rc = device_create_file(dev_root, &dev_attr_rescan);
+ put_device(dev_root);
+ if (rc)
+ return rc;
+ }
+
for_each_present_cpu(cpu) {
rc = smp_add_present_cpu(cpu);
if (rc)