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

powerpc: mpic: make mpic_subsys const

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the mpic_subsys variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240212-bus_cleanup-powerpc2-v2-3-8441b3f77827@marliere.net

authored by

Ricardo B. Marliere and committed by
Michael Ellerman
8e3d0b8d 565206aa

+2 -2
+1 -1
arch/powerpc/include/asm/mpic.h
··· 336 336 #endif 337 337 }; 338 338 339 - extern struct bus_type mpic_subsys; 339 + extern const struct bus_type mpic_subsys; 340 340 341 341 /* 342 342 * MPIC flags (passed to mpic_alloc)
+1 -1
arch/powerpc/sysdev/mpic.c
··· 49 49 #define DBG(fmt...) 50 50 #endif 51 51 52 - struct bus_type mpic_subsys = { 52 + const struct bus_type mpic_subsys = { 53 53 .name = "mpic", 54 54 .dev_name = "mpic", 55 55 };