All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kunwu Chan <kunwu.chan@linux.dev>
To: linux@armlinux.org.uk, krzk@kernel.org, andi.shyti@kernel.org,
	andriy.shevchenko@linux.intel.com, robh@kernel.org,
	gregkh@linuxfoundation.org, suzuki.poulose@arm.com,
	rmk+kernel@armlinux.org.uk
Cc: linux-kernel@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn>
Subject: [PATCH] amba: make amba_bustype constant
Date: Fri, 23 Aug 2024 14:42:03 +0800	[thread overview]
Message-ID: <20240823064203.119284-1-kunwu.chan@linux.dev> (raw)

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


             reply	other threads:[~2024-08-23  6:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23  6:42 Kunwu Chan [this message]
2024-08-23 13:48 ` [PATCH] amba: make amba_bustype constant 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240823064203.119284-1-kunwu.chan@linux.dev \
    --to=kunwu.chan@linux.dev \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=chentao@kylinos.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh@kernel.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.