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

powerpc: vio: make vio_bus_type 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 vio_bus_type 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-2-8441b3f77827@marliere.net

authored by

Ricardo B. Marliere and committed by
Michael Ellerman
565206aa e15d0127

+3 -3
+1 -1
arch/powerpc/include/asm/vio.h
··· 39 39 */ 40 40 #define VIO_CMO_MIN_ENT 1562624 41 41 42 - extern struct bus_type vio_bus_type; 42 + extern const struct bus_type vio_bus_type; 43 43 44 44 struct iommu_table; 45 45
+2 -2
arch/powerpc/platforms/pseries/vio.c
··· 1615 1615 }; 1616 1616 ATTRIBUTE_GROUPS(vio_cmo_dev); 1617 1617 1618 - struct bus_type vio_bus_type = { 1618 + const struct bus_type vio_bus_type = { 1619 1619 .name = "vio", 1620 1620 .dev_groups = vio_cmo_dev_groups, 1621 1621 .bus_groups = vio_bus_groups, ··· 1634 1634 }; 1635 1635 ATTRIBUTE_GROUPS(vio_dev); 1636 1636 1637 - struct bus_type vio_bus_type = { 1637 + const struct bus_type vio_bus_type = { 1638 1638 .name = "vio", 1639 1639 .dev_groups = vio_dev_groups, 1640 1640 .uevent = vio_hotplug,