* [PATCH] arm: make sa1111_bus_type const
@ 2025-09-18 13:44 Adrian Barnaś
2025-09-18 15:50 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Barnaś @ 2025-09-18 13:44 UTC (permalink / raw)
To: Russell King, linux-arm-kernel, linux-kernel
Cc: Greg Kroah-Hartman, Adrian Barnaś
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>
---
arch/arm/common/sa1111.c | 2 +-
arch/arm/include/asm/hardware/sa1111.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 3389a70e4d49..04ff75dcc20e 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -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,
diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h
index a815f39b4243..90b6a832108d 100644
--- a/arch/arm/include/asm/hardware/sa1111.h
+++ b/arch/arm/include/asm/hardware/sa1111.h
@@ -368,7 +368,7 @@
-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)
--
2.51.0.470.ga7dc726c21-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] arm: make sa1111_bus_type const
2025-09-18 13:44 [PATCH] arm: make sa1111_bus_type const Adrian Barnaś
@ 2025-09-18 15:50 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-18 15:50 UTC (permalink / raw)
To: Adrian Barnaś; +Cc: Russell King, linux-arm-kernel, linux-kernel
On Thu, Sep 18, 2025 at 01:44:28PM +0000, Adrian Barnaś wrote:
> 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>
> ---
> arch/arm/common/sa1111.c | 2 +-
> arch/arm/include/asm/hardware/sa1111.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-18 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 13:44 [PATCH] arm: make sa1111_bus_type const Adrian Barnaś
2025-09-18 15:50 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox