staging: typec: tcpm: Constify alternate modes
authorGuenter Roeck <linux@roeck-us.net>
Fri, 11 Aug 2017 04:15:39 +0000 (21:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Aug 2017 22:57:15 +0000 (15:57 -0700)
Constify alternate mode configuration data which won't be touched
by the driver.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/typec/tcpm.c
drivers/staging/typec/tcpm.h

index 2195c80235a1775612582650895756cd82a2559c..bad620fe323a80a0065c0a9b34d8827cad40f590 100644 (file)
@@ -3484,7 +3484,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
        }
 
        if (tcpc->config->alt_modes) {
-               struct typec_altmode_desc *paltmode = tcpc->config->alt_modes;
+               const struct typec_altmode_desc *paltmode = tcpc->config->alt_modes;
 
                i = 0;
                while (paltmode->svid && i < ARRAY_SIZE(port->port_altmode)) {
index 19c307d31a5a39267abe546451c89f953ccc0945..4c6b38cb2c8a950302620534a9ef4dd602d65c5b 100644 (file)
@@ -72,7 +72,7 @@ struct tcpc_config {
        enum typec_role default_role;
        bool try_role_hw;       /* try.{src,snk} implemented in hardware */
 
-       struct typec_altmode_desc *alt_modes;
+       const struct typec_altmode_desc *alt_modes;
 };
 
 enum tcpc_usb_switch {