[PATCH 3/4] platform/chrome: cros_typec_vdm: Mark port_amode_ops const
From: Stephen Boyd
Date: Mon Oct 02 2023 - 20:34:46 EST
Mark this struct of functions const so it moves to RO memory.
Cc: Prashant Malani <pmalani@xxxxxxxxxxxx>
Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
---
drivers/platform/chrome/cros_typec_vdm.c | 2 +-
drivers/platform/chrome/cros_typec_vdm.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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);
--
https://chromeos.dev