From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 18:28:53 +0000 (+0100) Subject: arm64: cpufeature: move to use bus_get_dev_root() X-Git-Tag: v6.6.17~5001^2~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb6b0cba1ea9d3f71bafef4eff4e7a9547085752;p=platform%2Fkernel%2Flinux-rpi.git arm64: cpufeature: 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: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Cc: James Morse Cc: Kristina Martsenko Cc: Marc Zyngier Cc: Ard Biesheuvel Cc: Vladimir Murzin Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230313182918.1312597-11-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 2e3e551..f3bab4b 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1490,10 +1490,18 @@ static const DEVICE_ATTR_RO(aarch32_el0); static int __init aarch32_el0_sysfs_init(void) { + struct device *dev_root; + int ret = 0; + if (!allow_mismatched_32bit_el0) return 0; - return device_create_file(cpu_subsys.dev_root, &dev_attr_aarch32_el0); + dev_root = bus_get_dev_root(&cpu_subsys); + if (dev_root) { + ret = device_create_file(dev_root, &dev_attr_aarch32_el0); + put_device(dev_root); + } + return ret; } device_initcall(aarch32_el0_sysfs_init);