OSDN Git Service

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 2195c80..bad620f 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 19c307d..4c6b38c 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 {