aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo B. Marliere <ricardo@marliere.net>2024-02-10 12:10:14 -0300
committerIwona Winiarska <iwona.winiarska@intel.com>2024-04-16 00:14:36 +0200
commited8c2dad25eb2fbaa61f2e32385ecc1aa34c2355 (patch)
tree33ad5891beca74f3cdc3b97497a0b5b1b9022026
parent0bbac3facb5d6cc0171c45c9873a2dc96bea9680 (diff)
downloadiio-ed8c2dad25eb2fbaa61f2e32385ecc1aa34c2355.tar.gz
peci: Make peci_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the peci_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@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240210-bus_cleanup-peci-v1-1-1e64bef6efc0@marliere.net Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
-rw-r--r--drivers/peci/core.c2
-rw-r--r--drivers/peci/internal.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/peci/core.c b/drivers/peci/core.c
index 0f83a9c6093bc..b2f8db967e9b5 100644
--- a/drivers/peci/core.c
+++ b/drivers/peci/core.c
@@ -201,7 +201,7 @@ static void peci_bus_device_remove(struct device *dev)
driver->remove(device);
}
-struct bus_type peci_bus_type = {
+const struct bus_type peci_bus_type = {
.name = "peci",
.match = peci_bus_device_match,
.probe = peci_bus_device_probe,
diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
index 9d75ea54504c3..8a896c256c5f2 100644
--- a/drivers/peci/internal.h
+++ b/drivers/peci/internal.h
@@ -81,7 +81,7 @@ extern const struct attribute_group *peci_device_groups[];
int peci_device_create(struct peci_controller *controller, u8 addr);
void peci_device_destroy(struct peci_device *device);
-extern struct bus_type peci_bus_type;
+extern const struct bus_type peci_bus_type;
extern const struct attribute_group *peci_bus_groups[];
/**