soc: qcom: apr: make aprbus const

Message ID 20240213-bus_cleanup-apr-v1-1-50c824eec06d@marliere.net
State New
Headers
Series soc: qcom: apr: make aprbus const |

Commit Message

Ricardo B. Marliere Feb. 13, 2024, 2:44 p.m. UTC
  Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the aprbus 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>
---
 drivers/soc/qcom/apr.c       | 2 +-
 include/linux/soc/qcom/apr.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


---
base-commit: f7b0172f074a435a34bc0902b6cdbf1a3e935e27
change-id: 20240213-bus_cleanup-apr-305f89f9058c

Best regards,
  

Comments

Bjorn Andersson Feb. 14, 2024, 5:57 p.m. UTC | #1
On Tue, 13 Feb 2024 11:44:01 -0300, Ricardo B. Marliere wrote:
> Since commit d492cc2573a0 ("driver core: device.h: make struct
> bus_type a const *"), the driver core can properly handle constant
> struct bus_type, move the aprbus variable to be a constant
> structure as well, placing it into read-only memory which can not be
> modified at runtime.
> 
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: apr: make aprbus const
      commit: d2e8899de71cd0a3c22a0eadfb9d54604d34eb96

Best regards,
  

Patch

diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c
index 1f8b315576a4..50749e870efa 100644
--- a/drivers/soc/qcom/apr.c
+++ b/drivers/soc/qcom/apr.c
@@ -399,7 +399,7 @@  static int apr_uevent(const struct device *dev, struct kobj_uevent_env *env)
 	return add_uevent_var(env, "MODALIAS=apr:%s", adev->name);
 }
 
-struct bus_type aprbus = {
+const struct bus_type aprbus = {
 	.name		= "aprbus",
 	.match		= apr_device_match,
 	.probe		= apr_device_probe,
diff --git a/include/linux/soc/qcom/apr.h b/include/linux/soc/qcom/apr.h
index be98aebcb3e1..7161a3183eda 100644
--- a/include/linux/soc/qcom/apr.h
+++ b/include/linux/soc/qcom/apr.h
@@ -9,7 +9,7 @@ 
 #include <dt-bindings/soc/qcom,apr.h>
 #include <dt-bindings/soc/qcom,gpr.h>
 
-extern struct bus_type aprbus;
+extern const struct bus_type aprbus;
 
 #define APR_HDR_LEN(hdr_len) ((hdr_len)/4)