diff mbox series

[3/4] platform/chrome: cros_typec_vdm: Mark port_amode_ops const

Message ID 20231003003429.1378109-4-swboyd@chromium.org (mailing list archive)
State Accepted
Commit 14e7c01cc3494b75c3ff1d099a2f5f76b1fcb01d
Headers show
Series platform/chrome: Random driver cleanups | expand

Commit Message

Stephen Boyd Oct. 3, 2023, 12:34 a.m. UTC
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>
---
 drivers/platform/chrome/cros_typec_vdm.c | 2 +-
 drivers/platform/chrome/cros_typec_vdm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
index 20515ee0a20e..3f632fd35000 100644
--- a/drivers/platform/chrome/cros_typec_vdm.c
+++ b/drivers/platform/chrome/cros_typec_vdm.c
@@ -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,
 };
diff --git a/drivers/platform/chrome/cros_typec_vdm.h b/drivers/platform/chrome/cros_typec_vdm.h
index 95a6a75d32b6..631bd2ce4b00 100644
--- a/drivers/platform/chrome/cros_typec_vdm.h
+++ b/drivers/platform/chrome/cros_typec_vdm.h
@@ -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);