net: dsa: constify probed name
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Sun, 17 Apr 2016 17:23:55 +0000 (13:23 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Apr 2016 22:54:14 +0000 (18:54 -0400)
Change the dsa_switch_driver.probe function to return a const char *.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/mv88e6060.c
drivers/net/dsa/mv88e6123.c
drivers/net/dsa/mv88e6131.c
drivers/net/dsa/mv88e6171.c
drivers/net/dsa/mv88e6352.c
drivers/net/dsa/mv88e6xxx.c
drivers/net/dsa/mv88e6xxx.h
include/net/dsa.h
net/dsa/dsa.c

index 7a5f0ef46bd6f909898dfee3cf20c3e2734a2e6b..448deb59b9a42dcbc2479a8e2ed3b522b471bc19 100644 (file)
@@ -135,9 +135,9 @@ static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds)
        return BCM_SF2_STATS_SIZE;
 }
 
-static char *bcm_sf2_sw_drv_probe(struct device *dsa_dev,
-                                 struct device *host_dev,
-                                 int sw_addr, void **_priv)
+static const char *bcm_sf2_sw_drv_probe(struct device *dsa_dev,
+                                       struct device *host_dev, int sw_addr,
+                                       void **_priv)
 {
        struct bcm_sf2_priv *priv;
 
index 92cebab9383e3190abb322c9695fcabf8d179d5c..e36b40886bd810c0c517b8ac3f2e320d9581ed9a 100644 (file)
@@ -51,7 +51,7 @@ static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
                        return __ret;                           \
        })
 
-static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr)
+static const char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr)
 {
        int ret;
 
@@ -69,13 +69,13 @@ static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr)
        return NULL;
 }
 
-static char *mv88e6060_drv_probe(struct device *dsa_dev,
-                                struct device *host_dev,
-                                int sw_addr, void **_priv)
+static const char *mv88e6060_drv_probe(struct device *dsa_dev,
+                                      struct device *host_dev, int sw_addr,
+                                      void **_priv)
 {
        struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
        struct mv88e6060_priv *priv;
-       char *name;
+       const char *name;
 
        name = mv88e6060_get_name(bus, sw_addr);
        if (name) {
index 140e44e50e8a0743f6cd6146c8051efb83a51be6..9701c0f9a60aaa34cb1c99bf77b12d3c93312298 100644 (file)
@@ -29,9 +29,9 @@ static const struct mv88e6xxx_switch_id mv88e6123_table[] = {
        { PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" },
 };
 
-static char *mv88e6123_drv_probe(struct device *dsa_dev,
-                                struct device *host_dev,
-                                int sw_addr, void **priv)
+static const char *mv88e6123_drv_probe(struct device *dsa_dev,
+                                      struct device *host_dev, int sw_addr,
+                                      void **priv)
 {
        return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
                                   mv88e6123_table,
index 34d297b650400f83545e00f4139426ad239ed09b..fa3a3546045375a1493e69eb0452acecb6e7d31c 100644 (file)
@@ -25,9 +25,9 @@ static const struct mv88e6xxx_switch_id mv88e6131_table[] = {
        { PORT_SWITCH_ID_6185, "Marvell 88E6185" },
 };
 
-static char *mv88e6131_drv_probe(struct device *dsa_dev,
-                                struct device *host_dev,
-                                int sw_addr, void **priv)
+static const char *mv88e6131_drv_probe(struct device *dsa_dev,
+                                      struct device *host_dev, int sw_addr,
+                                      void **priv)
 {
        return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
                                   mv88e6131_table,
index b7af2b78f8ee8129d568bdb72018114816abc9c4..8d86c9ee1adfe72963df481b406a93b561b2d400 100644 (file)
@@ -24,9 +24,9 @@ static const struct mv88e6xxx_switch_id mv88e6171_table[] = {
        { PORT_SWITCH_ID_6351, "Marvell 88E6351" },
 };
 
-static char *mv88e6171_drv_probe(struct device *dsa_dev,
-                                struct device *host_dev,
-                                int sw_addr, void **priv)
+static const char *mv88e6171_drv_probe(struct device *dsa_dev,
+                                      struct device *host_dev, int sw_addr,
+                                      void **priv)
 {
        return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
                                   mv88e6171_table,
index e8cb03fad21a32b5433f9f5eed2964d83fde720d..c7fa69c9a5648fa8833af77eae9c381e3a85eb14 100644 (file)
@@ -37,9 +37,9 @@ static const struct mv88e6xxx_switch_id mv88e6352_table[] = {
        { PORT_SWITCH_ID_6352_A1, "Marvell 88E6352 (A1)" },
 };
 
-static char *mv88e6352_drv_probe(struct device *dsa_dev,
-                                struct device *host_dev,
-                                int sw_addr, void **priv)
+static const char *mv88e6352_drv_probe(struct device *dsa_dev,
+                                      struct device *host_dev, int sw_addr,
+                                      void **priv)
 {
        return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
                                   mv88e6352_table,
index b018f20829fb1d5385e0680f92b1a05dc3f64efc..25d7fec98f8e3fbe11197ffbeedaf18f47e85aaa 100644 (file)
@@ -3173,9 +3173,10 @@ int mv88e6xxx_get_temp_alarm(struct dsa_switch *ds, bool *alarm)
 }
 #endif /* CONFIG_NET_DSA_HWMON */
 
-static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
-                                  const struct mv88e6xxx_switch_id *table,
-                                  unsigned int num)
+static const char *
+mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
+                     const struct mv88e6xxx_switch_id *table,
+                     unsigned int num)
 {
        int i, ret;
 
@@ -3205,14 +3206,14 @@ static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
        return NULL;
 }
 
-char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
-                         int sw_addr, void **priv,
-                         const struct mv88e6xxx_switch_id *table,
-                         unsigned int num)
+const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
+                               int sw_addr, void **priv,
+                               const struct mv88e6xxx_switch_id *table,
+                               unsigned int num)
 {
        struct mv88e6xxx_priv_state *ps;
        struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
-       char *name;
+       const char *name;
 
        if (!bus)
                return NULL;
index 0debb9f3cf0a0663dba203f8f22db6eee47265b0..5eb601398835b64bac15de6d3e728f99ae6a40ec 100644 (file)
@@ -462,10 +462,10 @@ struct mv88e6xxx_hw_stat {
 };
 
 int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active);
-char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
-                         int sw_addr, void **priv,
-                         const struct mv88e6xxx_switch_id *table,
-                         unsigned int num);
+const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
+                               int sw_addr, void **priv,
+                               const struct mv88e6xxx_switch_id *table,
+                               unsigned int num);
 
 int mv88e6xxx_setup_ports(struct dsa_switch *ds);
 int mv88e6xxx_setup_common(struct dsa_switch *ds);
index 689ebd3542ba9e4aa96e7d9d31e2231dfd0e88ca..c4bc42bd3538c7add51861bdddf30f16663b31f9 100644 (file)
@@ -217,8 +217,9 @@ struct dsa_switch_driver {
        /*
         * Probing and setup.
         */
-       char    *(*probe)(struct device *dsa_dev, struct device *host_dev,
-                         int sw_addr, void **priv);
+       const char      *(*probe)(struct device *dsa_dev,
+                                 struct device *host_dev, int sw_addr,
+                                 void **priv);
        int     (*setup)(struct dsa_switch *ds);
        int     (*set_addr)(struct dsa_switch *ds, u8 *addr);
        u32     (*get_phy_flags)(struct dsa_switch *ds, int port);
index 60ea98481806f361a09025344e48663c5a1c9b70..efa612f0ab9b16f140f4dbdefc5f3d0f74b2efba 100644 (file)
@@ -52,11 +52,11 @@ EXPORT_SYMBOL_GPL(unregister_switch_driver);
 
 static struct dsa_switch_driver *
 dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
-                char **_name, void **priv)
+                const char **_name, void **priv)
 {
        struct dsa_switch_driver *ret;
        struct list_head *list;
-       char *name;
+       const char *name;
 
        ret = NULL;
        name = NULL;
@@ -383,7 +383,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
        struct dsa_switch_driver *drv;
        struct dsa_switch *ds;
        int ret;
-       char *name;
+       const char *name;
        void *priv;
 
        /*
This page took 0.060248 seconds and 5 git commands to generate.