]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/chrome: cros_typec_vdm: Mark port_amode_ops const
authorStephen Boyd <swboyd@chromium.org>
Tue, 3 Oct 2023 00:34:27 +0000 (17:34 -0700)
committerTzung-Bi Shih <tzungbi@kernel.org>
Wed, 4 Oct 2023 03:40:54 +0000 (11:40 +0800)
Mark this struct of functions const so it moves to RO memory.

Cc: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Prashant Malani <pmalani@chromium.org>
Link: https://lore.kernel.org/r/20231003003429.1378109-4-swboyd@chromium.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_typec_vdm.c
drivers/platform/chrome/cros_typec_vdm.h

index 20515ee0a20e49e0fe1126d70ef3becf0d7dc0b0..3f632fd35000b46fc7a8805e16f79fcde3af50a5 100644 (file)
@@ -142,7 +142,7 @@ static int cros_typec_port_amode_vdm(struct typec_altmode *amode, const u32 hdr,
                           sizeof(req), NULL, 0);
 }
 
-struct typec_altmode_ops port_amode_ops = {
+const struct typec_altmode_ops port_amode_ops = {
        .enter = cros_typec_port_amode_enter,
        .vdm = cros_typec_port_amode_vdm,
 };
index 95a6a75d32b6bc723d6314d05b9df57d13d54038..631bd2ce4b003a83db547c36051525a06d4e8bd8 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <linux/usb/typec_altmode.h>
 
-extern struct typec_altmode_ops port_amode_ops;
+extern const struct typec_altmode_ops port_amode_ops;
 
 void cros_typec_handle_vdm_attention(struct cros_typec_data *typec, int port_num);
 void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num);