[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240208-bus_cleanup-rapidio-v1-1-c69040ab0151@marliere.net>
Date: Thu, 08 Feb 2024 16:12:21 -0300
From: "Ricardo B. Marliere" <ricardo@...liere.net>
To: Matt Porter <mporter@...nel.crashing.org>,
Alexandre Bounine <alex.bou9@...il.com>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Ricardo B. Marliere" <ricardo@...liere.net>
Subject: [PATCH] rapidio: make rio_bus_type const
Now that the driver core can properly handle constant struct bus_type,
move the rio_bus_type 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: Ricardo B. Marliere <ricardo@...liere.net>
---
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 1b3b4c2e015d..2baef45ee5ff 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 2cd637268b4f..e9ca2fb7133f 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;
---
base-commit: 547ab8fc4cb04a1a6b34377dd8fad34cd2c8a8e3
change-id: 20240208-bus_cleanup-rapidio-93b380dbbea5
Best regards,
--
Ricardo B. Marliere <ricardo@...liere.net>
Powered by blists - more mailing lists