Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: qcom: apr: make aprbus const

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>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240213-bus_cleanup-apr-v1-1-50c824eec06d@marliere.net
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Ricardo B. Marliere and committed by
Bjorn Andersson
d2e8899d 0ebeba91

+2 -2
+1 -1
drivers/soc/qcom/apr.c
··· 399 399 return add_uevent_var(env, "MODALIAS=apr:%s", adev->name); 400 400 } 401 401 402 - struct bus_type aprbus = { 402 + const struct bus_type aprbus = { 403 403 .name = "aprbus", 404 404 .match = apr_device_match, 405 405 .probe = apr_device_probe,
+1 -1
include/linux/soc/qcom/apr.h
··· 9 9 #include <dt-bindings/soc/qcom,apr.h> 10 10 #include <dt-bindings/soc/qcom,gpr.h> 11 11 12 - extern struct bus_type aprbus; 12 + extern const struct bus_type aprbus; 13 13 14 14 #define APR_HDR_LEN(hdr_len) ((hdr_len)/4) 15 15