Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

parport: make parport_bus_type const

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.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-parport-v1-1-e6a0f756bbb8@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricardo B. Marliere and committed by
Greg Kroah-Hartman
fca3eff7 b5dd4241

+1 -1
+1 -1
drivers/parport/share.c
··· 130 130 return drv->probe(to_pardevice(dev)); 131 131 } 132 132 133 - static struct bus_type parport_bus_type = { 133 + static const struct bus_type parport_bus_type = { 134 134 .name = "parport", 135 135 .probe = parport_probe, 136 136 };