]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm: make sa1111_bus_type const
authorAdrian Barnaś <abarnas@google.com>
Thu, 18 Sep 2025 13:44:28 +0000 (13:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Oct 2025 05:54:54 +0000 (07:54 +0200)
Because driver core can properly handle constant struct bus_type,
move the sa1111_bus_type to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Signed-off-by: Adrian Barnaś <abarnas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20250918134429.270814-1-abarnas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/common/sa1111.c
arch/arm/include/asm/hardware/sa1111.h

index 3389a70e4d4978acc7ab5479b3998fd54e3eb7a6..04ff75dcc20e759d1e55b3469deca95d6c535560 100644 (file)
@@ -1371,7 +1371,7 @@ static void sa1111_bus_remove(struct device *dev)
                drv->remove(sadev);
 }
 
-struct bus_type sa1111_bus_type = {
+const struct bus_type sa1111_bus_type = {
        .name           = "sa1111-rab",
        .match          = sa1111_match,
        .probe          = sa1111_bus_probe,
index a815f39b4243904787ab180e87f7418db70d56dc..90b6a832108dddc22ca16817b2aeb48eca5a7a1c 100644 (file)
 
 
 
-extern struct bus_type sa1111_bus_type;
+extern const struct bus_type sa1111_bus_type;
 
 #define SA1111_DEVID_SBI       (1 << 0)
 #define SA1111_DEVID_SK                (1 << 1)