mips: bus: make mips_cdmm_bustype const
authorRicardo B. Marliere <ricardo@marliere.net>
Tue, 13 Feb 2024 14:49:24 +0000 (11:49 -0300)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 20 Feb 2024 12:36:34 +0000 (13:36 +0100)
Now that the driver core can properly handle constant struct bus_type,
move the mips_cdmm_bustype 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>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/cdmm.h
drivers/bus/mips_cdmm.c

index c06dbf8..81fa990 100644 (file)
@@ -63,7 +63,7 @@ struct mips_cdmm_driver {
  */
 phys_addr_t mips_cdmm_phys_base(void);
 
-extern struct bus_type mips_cdmm_bustype;
+extern const struct bus_type mips_cdmm_bustype;
 void __iomem *mips_cdmm_early_probe(unsigned int dev_type);
 
 #define to_mips_cdmm_device(d) container_of(d, struct mips_cdmm_device, dev)
index 554e199..8baf14b 100644 (file)
@@ -118,7 +118,7 @@ static struct attribute *mips_cdmm_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(mips_cdmm_dev);
 
-struct bus_type mips_cdmm_bustype = {
+const struct bus_type mips_cdmm_bustype = {
        .name           = "cdmm",
        .dev_groups     = mips_cdmm_dev_groups,
        .match          = mips_cdmm_match,