staging: fieldbus: make anybus_bus const

Message ID 20240203-bus_cleanup-staging-v1-1-a13448ddb4c7@marliere.net
State New
Headers
Series staging: fieldbus: make anybus_bus const |

Commit Message

Ricardo B. Marliere Feb. 3, 2024, 6:11 p.m. UTC
  Now that the driver core can properly handle constant struct bus_type,
move the anybus_bus 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 <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 drivers/staging/fieldbus/anybuss/host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: ce54e9342124ededf0a00ed4e8a8aee535bfbf00
change-id: 20240203-bus_cleanup-staging-0cda1a5a70e4

Best regards,
  

Patch

diff --git a/drivers/staging/fieldbus/anybuss/host.c b/drivers/staging/fieldbus/anybuss/host.c
index cd86b9c9e345..410e6f8073c0 100644
--- a/drivers/staging/fieldbus/anybuss/host.c
+++ b/drivers/staging/fieldbus/anybuss/host.c
@@ -1195,7 +1195,7 @@  static void anybus_bus_remove(struct device *dev)
 		adrv->remove(to_anybuss_client(dev));
 }
 
-static struct bus_type anybus_bus = {
+static const struct bus_type anybus_bus = {
 	.name		= "anybuss",
 	.match		= anybus_bus_match,
 	.probe		= anybus_bus_probe,