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

platform/chrome: cros_typec_vdm: Mark port_amode_ops const

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>

authored by

Stephen Boyd and committed by
Tzung-Bi Shih
14e7c01c 2b055bf8

+2 -2
+1 -1
drivers/platform/chrome/cros_typec_vdm.c
··· 142 142 sizeof(req), NULL, 0); 143 143 } 144 144 145 - struct typec_altmode_ops port_amode_ops = { 145 + const struct typec_altmode_ops port_amode_ops = { 146 146 .enter = cros_typec_port_amode_enter, 147 147 .vdm = cros_typec_port_amode_vdm, 148 148 };
+1 -1
drivers/platform/chrome/cros_typec_vdm.h
··· 5 5 6 6 #include <linux/usb/typec_altmode.h> 7 7 8 - extern struct typec_altmode_ops port_amode_ops; 8 + extern const struct typec_altmode_ops port_amode_ops; 9 9 10 10 void cros_typec_handle_vdm_attention(struct cros_typec_data *typec, int port_num); 11 11 void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num);