parport: constify the struct device_type usage

Message ID 20240219-device_cleanup-parport-v1-1-1d2cac6c884b@marliere.net
State New
Headers
Series parport: constify the struct device_type usage |

Commit Message

Ricardo B. Marliere Feb. 19, 2024, 7:50 p.m. UTC
  Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
parport_device_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>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 drivers/parport/share.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d
change-id: 20240219-device_cleanup-parport-ba048a859198

Best regards,
  

Patch

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 49c74ded8a53..33159392d70c 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -101,7 +101,7 @@  static struct parport_operations dead_ops = {
 	.owner		= NULL,
 };
 
-static struct device_type parport_device_type = {
+static const struct device_type parport_device_type = {
 	.name = "parport",
 };