public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amba: make amba_bustype constant
@ 2024-08-23  6:42 Kunwu Chan
  2024-08-23 13:48 ` Andy Shevchenko
  2024-08-27 13:46 ` Russell King (Oracle)
  0 siblings, 2 replies; 15+ messages in thread
From: Kunwu Chan @ 2024-08-23  6:42 UTC (permalink / raw)
  To: linux, krzk, andi.shyti, andriy.shevchenko, robh, gregkh,
	suzuki.poulose, rmk+kernel
  Cc: linux-kernel, Kunwu Chan

From: Kunwu Chan <chentao@kylinos.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@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kunwu Chan <chentao@kylinos.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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-09-05  8:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23  6:42 [PATCH] amba: make amba_bustype constant Kunwu Chan
2024-08-23 13:48 ` Andy Shevchenko
2024-08-26  8:20   ` Kunwu Chan
2024-08-26 10:08   ` Kunwu Chan
2024-08-26 10:40     ` Andy Shevchenko
2024-08-27  7:45       ` Kunwu Chan
2024-08-27 13:37         ` Andy Shevchenko
2024-08-28  2:51           ` Kunwu Chan
2024-08-28 13:17             ` Andy Shevchenko
2024-08-29  1:31               ` Kunwu Chan
2024-09-04 13:58                 ` Russell King (Oracle)
2024-09-04 14:07                   ` Andy Shevchenko
2024-09-05  8:51                   ` Kunwu Chan
2024-08-27 13:46 ` Russell King (Oracle)
2024-08-28  3:00   ` Kunwu Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox