media: bt8xx: make bttv_sub_bus_type const
authorRicardo B. Marliere <ricardo@marliere.net>
Fri, 9 Feb 2024 23:27:48 +0000 (20:27 -0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 16 Feb 2024 10:46:33 +0000 (11:46 +0100)
Now that the driver core can properly handle constant struct bus_type,
move the bttv_sub_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@linuxfoundation.org>
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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/bt8xx/bttv-gpio.c
drivers/media/pci/bt8xx/bttvp.h

index a2b18e2bed1b0bc00669a75936a0756953fb9a4d..6b7fea50328c2f8b0bb6b6e4b64238c209d5e8cd 100644 (file)
@@ -55,7 +55,7 @@ static void bttv_sub_remove(struct device *dev)
                sub->remove(sdev);
 }
 
-struct bus_type bttv_sub_bus_type = {
+const struct bus_type bttv_sub_bus_type = {
        .name   = "bttv-sub",
        .match  = &bttv_sub_bus_match,
        .probe  = bttv_sub_probe,
index 0368a583cf077f3ff8fff441c9f2e056a197dad2..a534e63b9a37bc5fdb27cc5b558ae885c7186715 100644 (file)
@@ -234,7 +234,7 @@ int bttv_s_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f);
 /* ---------------------------------------------------------- */
 /* bttv-gpio.c */
 
-extern struct bus_type bttv_sub_bus_type;
+extern const struct bus_type bttv_sub_bus_type;
 int bttv_sub_add_device(struct bttv_core *core, char *name);
 int bttv_sub_del_devices(struct bttv_core *core);