2024-02-09 07:05:26

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH 0/2] staging: struct bus_type cleanup

This series is part of an effort to cleanup the users of the driver
core.

Signed-off-by: Ricardo B. Marliere <[email protected]>
---
Ricardo B. Marliere (2):
staging: vc04_services: vchiq_arm: make vchiq_bus_type const
staging: vme: make vme_bus_type const

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 2 +-
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h | 2 +-
drivers/staging/vme_user/vme.c | 2 +-
drivers/staging/vme_user/vme.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: ce54e9342124ededf0a00ed4e8a8aee535bfbf00
change-id: 20240208-bus_cleanup-staging2-d8906b09f1d0

Best regards,
--
Ricardo B. Marliere <[email protected]>



2024-02-10 08:01:23

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH 1/2] staging: vc04_services: vchiq_arm: make vchiq_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the vchiq_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 2 +-
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 933027e0011e..68f830d75531 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -37,7 +37,7 @@ static int vchiq_bus_probe(struct device *dev)
return driver->probe(device);
}

-struct bus_type vchiq_bus_type = {
+const struct bus_type vchiq_bus_type = {
.name = "vchiq-bus",
.match = vchiq_bus_type_match,
.uevent = vchiq_bus_uevent,
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
index caa6fdf25bb1..4db86e76edbd 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
@@ -34,7 +34,7 @@ static inline struct vchiq_driver *to_vchiq_driver(struct device_driver *d)
return container_of(d, struct vchiq_driver, driver);
}

-extern struct bus_type vchiq_bus_type;
+extern const struct bus_type vchiq_bus_type;

struct vchiq_device *
vchiq_device_register(struct device *parent, const char *name);

--
2.43.0