[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240823064203.119284-1-kunwu.chan@linux.dev>
Date: Fri, 23 Aug 2024 14:42:03 +0800
From: Kunwu Chan <kunwu.chan@...ux.dev>
To: linux@...linux.org.uk,
	krzk@...nel.org,
	andi.shyti@...nel.org,
	andriy.shevchenko@...ux.intel.com,
	robh@...nel.org,
	gregkh@...uxfoundation.org,
	suzuki.poulose@....com,
	rmk+kernel@...linux.org.uk
Cc: linux-kernel@...r.kernel.org,
	Kunwu Chan <chentao@...inos.cn>
Subject: [PATCH] amba: make amba_bustype constant
From: Kunwu Chan <chentao@...inos.cn>
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 <gregkh@...uxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Kunwu Chan <chentao@...inos.cn>
---
 drivers/amba/bus.c       | 2 +-
 include/linux/amba/bus.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 34bc880ca20b..0230c43377c1 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 958a55bcc708..dda2f3ea89cb 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)
 
-- 
2.41.0
Powered by blists - more mailing lists
 
