From: "Adrian Barnaś" <abarnas@google.com>
To: Matt Porter <mporter@kernel.crashing.org>,
Alexandre Bounine <alex.bou9@gmail.com>,
linux-kernel@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Adrian Barnaś" <abarnas@google.com>
Subject: [PATCH] drivers: rapidio: make rio_bus_type const
Date: Fri, 19 Sep 2025 07:32:01 +0000 [thread overview]
Message-ID: <20250919073201.751348-1-abarnas@google.com> (raw)
Because driver core can properly handle constant struct bus_type,
move the rio_bus_type to be a constant structure as well, placing it into
read-only memory which can not be modified at runtime.
Signed-off-by: Adrian Barnaś <abarnas@google.com>
---
drivers/rapidio/rio-driver.c | 2 +-
include/linux/rio.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c
index 238250e69005..bcfe0b45b377 100644
--- a/drivers/rapidio/rio-driver.c
+++ b/drivers/rapidio/rio-driver.c
@@ -227,7 +227,7 @@ struct class rio_mport_class = {
};
EXPORT_SYMBOL_GPL(rio_mport_class);
-struct bus_type rio_bus_type = {
+const struct bus_type rio_bus_type = {
.name = "rapidio",
.match = rio_match_bus,
.dev_groups = rio_dev_groups,
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 3c29f40f3c94..2c29f21ba9e5 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -78,7 +78,7 @@
#define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */
#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */
-extern struct bus_type rio_bus_type;
+extern const struct bus_type rio_bus_type;
extern struct class rio_mport_class;
struct rio_mport;
--
2.51.0.534.gc79095c0ca-goog
next reply other threads:[~2025-09-19 7:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 7:32 Adrian Barnaś [this message]
2025-09-19 15:39 ` Greg Kroah-Hartman
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=20250919073201.751348-1-abarnas@google.com \
--to=abarnas@google.com \
--cc=alex.bou9@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mporter@kernel.crashing.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®