mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 15:42:32 +00:00
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>
This commit is contained in:
parent
efde611b0a
commit
0209d144e3
10 changed files with 39 additions and 37 deletions
|
@ -135,9 +135,9 @@ static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds)
|
||||||
return BCM_SF2_STATS_SIZE;
|
return BCM_SF2_STATS_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *bcm_sf2_sw_drv_probe(struct device *dsa_dev,
|
static const char *bcm_sf2_sw_drv_probe(struct device *dsa_dev,
|
||||||
struct device *host_dev,
|
struct device *host_dev, int sw_addr,
|
||||||
int sw_addr, void **_priv)
|
void **_priv)
|
||||||
{
|
{
|
||||||
struct bcm_sf2_priv *priv;
|
struct bcm_sf2_priv *priv;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
|
||||||
return __ret; \
|
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;
|
int ret;
|
||||||
|
|
||||||
|
@ -69,13 +69,13 @@ static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *mv88e6060_drv_probe(struct device *dsa_dev,
|
static const char *mv88e6060_drv_probe(struct device *dsa_dev,
|
||||||
struct device *host_dev,
|
struct device *host_dev, int sw_addr,
|
||||||
int sw_addr, void **_priv)
|
void **_priv)
|
||||||
{
|
{
|
||||||
struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
|
struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
|
||||||
struct mv88e6060_priv *priv;
|
struct mv88e6060_priv *priv;
|
||||||
char *name;
|
const char *name;
|
||||||
|
|
||||||
name = mv88e6060_get_name(bus, sw_addr);
|
name = mv88e6060_get_name(bus, sw_addr);
|
||||||
if (name) {
|
if (name) {
|
||||||
|
|
|
@ -29,9 +29,9 @@ static const struct mv88e6xxx_switch_id mv88e6123_table[] = {
|
||||||
{ PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" },
|
{ PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *mv88e6123_drv_probe(struct device *dsa_dev,
|
static const char *mv88e6123_drv_probe(struct device *dsa_dev,
|
||||||
struct device *host_dev,
|
struct device *host_dev, int sw_addr,
|
||||||
int sw_addr, void **priv)
|
void **priv)
|
||||||
{
|
{
|
||||||
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
||||||
mv88e6123_table,
|
mv88e6123_table,
|
||||||
|
|
|
@ -25,9 +25,9 @@ static const struct mv88e6xxx_switch_id mv88e6131_table[] = {
|
||||||
{ PORT_SWITCH_ID_6185, "Marvell 88E6185" },
|
{ PORT_SWITCH_ID_6185, "Marvell 88E6185" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *mv88e6131_drv_probe(struct device *dsa_dev,
|
static const char *mv88e6131_drv_probe(struct device *dsa_dev,
|
||||||
struct device *host_dev,
|
struct device *host_dev, int sw_addr,
|
||||||
int sw_addr, void **priv)
|
void **priv)
|
||||||
{
|
{
|
||||||
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
||||||
mv88e6131_table,
|
mv88e6131_table,
|
||||||
|
|
|
@ -24,9 +24,9 @@ static const struct mv88e6xxx_switch_id mv88e6171_table[] = {
|
||||||
{ PORT_SWITCH_ID_6351, "Marvell 88E6351" },
|
{ PORT_SWITCH_ID_6351, "Marvell 88E6351" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *mv88e6171_drv_probe(struct device *dsa_dev,
|
static const char *mv88e6171_drv_probe(struct device *dsa_dev,
|
||||||
struct device *host_dev,
|
struct device *host_dev, int sw_addr,
|
||||||
int sw_addr, void **priv)
|
void **priv)
|
||||||
{
|
{
|
||||||
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
||||||
mv88e6171_table,
|
mv88e6171_table,
|
||||||
|
|
|
@ -37,9 +37,9 @@ static const struct mv88e6xxx_switch_id mv88e6352_table[] = {
|
||||||
{ PORT_SWITCH_ID_6352_A1, "Marvell 88E6352 (A1)" },
|
{ PORT_SWITCH_ID_6352_A1, "Marvell 88E6352 (A1)" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *mv88e6352_drv_probe(struct device *dsa_dev,
|
static const char *mv88e6352_drv_probe(struct device *dsa_dev,
|
||||||
struct device *host_dev,
|
struct device *host_dev, int sw_addr,
|
||||||
int sw_addr, void **priv)
|
void **priv)
|
||||||
{
|
{
|
||||||
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
|
||||||
mv88e6352_table,
|
mv88e6352_table,
|
||||||
|
|
|
@ -3173,9 +3173,10 @@ int mv88e6xxx_get_temp_alarm(struct dsa_switch *ds, bool *alarm)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NET_DSA_HWMON */
|
#endif /* CONFIG_NET_DSA_HWMON */
|
||||||
|
|
||||||
static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
|
static const char *
|
||||||
const struct mv88e6xxx_switch_id *table,
|
mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
|
||||||
unsigned int num)
|
const struct mv88e6xxx_switch_id *table,
|
||||||
|
unsigned int num)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
|
@ -3205,14 +3206,14 @@ static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
|
const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
|
||||||
int sw_addr, void **priv,
|
int sw_addr, void **priv,
|
||||||
const struct mv88e6xxx_switch_id *table,
|
const struct mv88e6xxx_switch_id *table,
|
||||||
unsigned int num)
|
unsigned int num)
|
||||||
{
|
{
|
||||||
struct mv88e6xxx_priv_state *ps;
|
struct mv88e6xxx_priv_state *ps;
|
||||||
struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
|
struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
|
||||||
char *name;
|
const char *name;
|
||||||
|
|
||||||
if (!bus)
|
if (!bus)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -462,10 +462,10 @@ struct mv88e6xxx_hw_stat {
|
||||||
};
|
};
|
||||||
|
|
||||||
int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active);
|
int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active);
|
||||||
char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
|
const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
|
||||||
int sw_addr, void **priv,
|
int sw_addr, void **priv,
|
||||||
const struct mv88e6xxx_switch_id *table,
|
const struct mv88e6xxx_switch_id *table,
|
||||||
unsigned int num);
|
unsigned int num);
|
||||||
|
|
||||||
int mv88e6xxx_setup_ports(struct dsa_switch *ds);
|
int mv88e6xxx_setup_ports(struct dsa_switch *ds);
|
||||||
int mv88e6xxx_setup_common(struct dsa_switch *ds);
|
int mv88e6xxx_setup_common(struct dsa_switch *ds);
|
||||||
|
|
|
@ -217,8 +217,9 @@ struct dsa_switch_driver {
|
||||||
/*
|
/*
|
||||||
* Probing and setup.
|
* Probing and setup.
|
||||||
*/
|
*/
|
||||||
char *(*probe)(struct device *dsa_dev, struct device *host_dev,
|
const char *(*probe)(struct device *dsa_dev,
|
||||||
int sw_addr, void **priv);
|
struct device *host_dev, int sw_addr,
|
||||||
|
void **priv);
|
||||||
int (*setup)(struct dsa_switch *ds);
|
int (*setup)(struct dsa_switch *ds);
|
||||||
int (*set_addr)(struct dsa_switch *ds, u8 *addr);
|
int (*set_addr)(struct dsa_switch *ds, u8 *addr);
|
||||||
u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
|
u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
|
||||||
|
|
|
@ -52,11 +52,11 @@ EXPORT_SYMBOL_GPL(unregister_switch_driver);
|
||||||
|
|
||||||
static struct dsa_switch_driver *
|
static struct dsa_switch_driver *
|
||||||
dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
|
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 dsa_switch_driver *ret;
|
||||||
struct list_head *list;
|
struct list_head *list;
|
||||||
char *name;
|
const char *name;
|
||||||
|
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
name = 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_driver *drv;
|
||||||
struct dsa_switch *ds;
|
struct dsa_switch *ds;
|
||||||
int ret;
|
int ret;
|
||||||
char *name;
|
const char *name;
|
||||||
void *priv;
|
void *priv;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue