Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: constify probed name

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>

authored by

Vivien Didelot and committed by
David S. Miller
0209d144 efde611b

+39 -37
+3 -3
drivers/net/dsa/bcm_sf2.c
··· 135 135 return BCM_SF2_STATS_SIZE; 136 136 } 137 137 138 - static char *bcm_sf2_sw_drv_probe(struct device *dsa_dev, 139 - struct device *host_dev, 140 - int sw_addr, void **_priv) 138 + static const char *bcm_sf2_sw_drv_probe(struct device *dsa_dev, 139 + struct device *host_dev, int sw_addr, 140 + void **_priv) 141 141 { 142 142 struct bcm_sf2_priv *priv; 143 143
+5 -5
drivers/net/dsa/mv88e6060.c
··· 51 51 return __ret; \ 52 52 }) 53 53 54 - static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr) 54 + static const char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr) 55 55 { 56 56 int ret; 57 57 ··· 69 69 return NULL; 70 70 } 71 71 72 - static char *mv88e6060_drv_probe(struct device *dsa_dev, 73 - struct device *host_dev, 74 - int sw_addr, void **_priv) 72 + static const char *mv88e6060_drv_probe(struct device *dsa_dev, 73 + struct device *host_dev, int sw_addr, 74 + void **_priv) 75 75 { 76 76 struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev); 77 77 struct mv88e6060_priv *priv; 78 - char *name; 78 + const char *name; 79 79 80 80 name = mv88e6060_get_name(bus, sw_addr); 81 81 if (name) {
+3 -3
drivers/net/dsa/mv88e6123.c
··· 29 29 { PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" }, 30 30 }; 31 31 32 - static char *mv88e6123_drv_probe(struct device *dsa_dev, 33 - struct device *host_dev, 34 - int sw_addr, void **priv) 32 + static const char *mv88e6123_drv_probe(struct device *dsa_dev, 33 + struct device *host_dev, int sw_addr, 34 + void **priv) 35 35 { 36 36 return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, 37 37 mv88e6123_table,
+3 -3
drivers/net/dsa/mv88e6131.c
··· 25 25 { PORT_SWITCH_ID_6185, "Marvell 88E6185" }, 26 26 }; 27 27 28 - static char *mv88e6131_drv_probe(struct device *dsa_dev, 29 - struct device *host_dev, 30 - int sw_addr, void **priv) 28 + static const char *mv88e6131_drv_probe(struct device *dsa_dev, 29 + struct device *host_dev, int sw_addr, 30 + void **priv) 31 31 { 32 32 return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, 33 33 mv88e6131_table,
+3 -3
drivers/net/dsa/mv88e6171.c
··· 24 24 { PORT_SWITCH_ID_6351, "Marvell 88E6351" }, 25 25 }; 26 26 27 - static char *mv88e6171_drv_probe(struct device *dsa_dev, 28 - struct device *host_dev, 29 - int sw_addr, void **priv) 27 + static const char *mv88e6171_drv_probe(struct device *dsa_dev, 28 + struct device *host_dev, int sw_addr, 29 + void **priv) 30 30 { 31 31 return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, 32 32 mv88e6171_table,
+3 -3
drivers/net/dsa/mv88e6352.c
··· 37 37 { PORT_SWITCH_ID_6352_A1, "Marvell 88E6352 (A1)" }, 38 38 }; 39 39 40 - static char *mv88e6352_drv_probe(struct device *dsa_dev, 41 - struct device *host_dev, 42 - int sw_addr, void **priv) 40 + static const char *mv88e6352_drv_probe(struct device *dsa_dev, 41 + struct device *host_dev, int sw_addr, 42 + void **priv) 43 43 { 44 44 return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, 45 45 mv88e6352_table,
+9 -8
drivers/net/dsa/mv88e6xxx.c
··· 3173 3173 } 3174 3174 #endif /* CONFIG_NET_DSA_HWMON */ 3175 3175 3176 - static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr, 3177 - const struct mv88e6xxx_switch_id *table, 3178 - unsigned int num) 3176 + static const char * 3177 + mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr, 3178 + const struct mv88e6xxx_switch_id *table, 3179 + unsigned int num) 3179 3180 { 3180 3181 int i, ret; 3181 3182 ··· 3206 3205 return NULL; 3207 3206 } 3208 3207 3209 - char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, 3210 - int sw_addr, void **priv, 3211 - const struct mv88e6xxx_switch_id *table, 3212 - unsigned int num) 3208 + const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, 3209 + int sw_addr, void **priv, 3210 + const struct mv88e6xxx_switch_id *table, 3211 + unsigned int num) 3213 3212 { 3214 3213 struct mv88e6xxx_priv_state *ps; 3215 3214 struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev); 3216 - char *name; 3215 + const char *name; 3217 3216 3218 3217 if (!bus) 3219 3218 return NULL;
+4 -4
drivers/net/dsa/mv88e6xxx.h
··· 462 462 }; 463 463 464 464 int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active); 465 - char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, 466 - int sw_addr, void **priv, 467 - const struct mv88e6xxx_switch_id *table, 468 - unsigned int num); 465 + const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, 466 + int sw_addr, void **priv, 467 + const struct mv88e6xxx_switch_id *table, 468 + unsigned int num); 469 469 470 470 int mv88e6xxx_setup_ports(struct dsa_switch *ds); 471 471 int mv88e6xxx_setup_common(struct dsa_switch *ds);
+3 -2
include/net/dsa.h
··· 217 217 /* 218 218 * Probing and setup. 219 219 */ 220 - char *(*probe)(struct device *dsa_dev, struct device *host_dev, 221 - int sw_addr, void **priv); 220 + const char *(*probe)(struct device *dsa_dev, 221 + struct device *host_dev, int sw_addr, 222 + void **priv); 222 223 int (*setup)(struct dsa_switch *ds); 223 224 int (*set_addr)(struct dsa_switch *ds, u8 *addr); 224 225 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
+3 -3
net/dsa/dsa.c
··· 52 52 53 53 static struct dsa_switch_driver * 54 54 dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr, 55 - char **_name, void **priv) 55 + const char **_name, void **priv) 56 56 { 57 57 struct dsa_switch_driver *ret; 58 58 struct list_head *list; 59 - char *name; 59 + const char *name; 60 60 61 61 ret = NULL; 62 62 name = NULL; ··· 383 383 struct dsa_switch_driver *drv; 384 384 struct dsa_switch *ds; 385 385 int ret; 386 - char *name; 386 + const char *name; 387 387 void *priv; 388 388 389 389 /*