[PATCH] parport: make parport_bus_type const

From: Ricardo B. Marliere
Date: Sun Feb 04 2024 - 15:25:31 EST


Now that the driver core can properly handle constant struct bus_type,
move the parport_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@xxxxxxxxxxxxxxxxxxx>
Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>
---
drivers/parport/share.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 49c74ded8a53..08dfa74be3c5 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -130,7 +130,7 @@ static int parport_probe(struct device *dev)
return drv->probe(to_pardevice(dev));
}

-static struct bus_type parport_bus_type = {
+static const struct bus_type parport_bus_type = {
.name = "parport",
.probe = parport_probe,
};

---
base-commit: 41b9fb381a486360b2daaec0c7480f8e3ff72bc7
change-id: 20240204-bus_cleanup-parport-a016e7319d81

Best regards,
--
Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>