From: Kunwu Chan Date: Mon, 2 Sep 2024 06:43:23 +0000 (+0100) Subject: ARM: 9416/1: amba: make amba_bustype constant X-Git-Tag: v6.12-rc1~230^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4d398a573d0f0c98c39d4af1866a3edaec4959c;p=thirdparty%2Fkernel%2Flinux.git ARM: 9416/1: amba: make amba_bustype constant 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 amba_bustype variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Kunwu Chan Signed-off-by: Russell King (Oracle) --- diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 34bc880ca20bd..0230c43377c1d 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -435,7 +435,7 @@ static const struct dev_pm_ops amba_pm = { * DMA configuration for platform and AMBA bus is same. So here we reuse * platform's DMA config routine. */ -struct bus_type amba_bustype = { +const struct bus_type amba_bustype = { .name = "amba", .dev_groups = amba_dev_groups, .match = amba_match, diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 958a55bcc7080..dda2f3ea89cb5 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -105,7 +105,7 @@ enum amba_vendor { AMBA_VENDOR_LSI = 0xb6, }; -extern struct bus_type amba_bustype; +extern const struct bus_type amba_bustype; #define to_amba_device(d) container_of_const(d, struct amba_device, dev)