Commit 206e41fe authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: remove useless argument in legacy setup

dsa_switch_alloc() already assigns ds-dev, which can be used in
dsa_switch_setup_one and dsa_cpu_dsa_setups instead of requiring an
additional struct device argument.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e00e2197
...@@ -78,7 +78,7 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr, ...@@ -78,7 +78,7 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
} }
/* basic switch operations **************************************************/ /* basic switch operations **************************************************/
static int dsa_cpu_dsa_setups(struct dsa_switch *ds, struct device *dev) static int dsa_cpu_dsa_setups(struct dsa_switch *ds)
{ {
struct dsa_port *dport; struct dsa_port *dport;
int ret, port; int ret, port;
...@@ -88,15 +88,15 @@ static int dsa_cpu_dsa_setups(struct dsa_switch *ds, struct device *dev) ...@@ -88,15 +88,15 @@ static int dsa_cpu_dsa_setups(struct dsa_switch *ds, struct device *dev)
continue; continue;
dport = &ds->ports[port]; dport = &ds->ports[port];
ret = dsa_cpu_dsa_setup(ds, dev, dport, port); ret = dsa_cpu_dsa_setup(ds, ds->dev, dport, port);
if (ret) if (ret)
return ret; return ret;
} }
return 0; return 0;
} }
static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master, static int dsa_switch_setup_one(struct dsa_switch *ds,
struct device *parent) struct net_device *master)
{ {
const struct dsa_switch_ops *ops = ds->ops; const struct dsa_switch_ops *ops = ds->ops;
struct dsa_switch_tree *dst = ds->dst; struct dsa_switch_tree *dst = ds->dst;
...@@ -176,7 +176,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master ...@@ -176,7 +176,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master
} }
if (!ds->slave_mii_bus && ops->phy_read) { if (!ds->slave_mii_bus && ops->phy_read) {
ds->slave_mii_bus = devm_mdiobus_alloc(parent); ds->slave_mii_bus = devm_mdiobus_alloc(ds->dev);
if (!ds->slave_mii_bus) if (!ds->slave_mii_bus)
return -ENOMEM; return -ENOMEM;
dsa_slave_mii_bus_init(ds); dsa_slave_mii_bus_init(ds);
...@@ -196,14 +196,14 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master ...@@ -196,14 +196,14 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master
if (!(ds->enabled_port_mask & (1 << i))) if (!(ds->enabled_port_mask & (1 << i)))
continue; continue;
ret = dsa_slave_create(ds, parent, i, cd->port_names[i]); ret = dsa_slave_create(ds, ds->dev, i, cd->port_names[i]);
if (ret < 0) if (ret < 0)
netdev_err(master, "[%d]: can't create dsa slave device for port %d(%s): %d\n", netdev_err(master, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
index, i, cd->port_names[i], ret); index, i, cd->port_names[i], ret);
} }
/* Perform configuration of the CPU and DSA ports */ /* Perform configuration of the CPU and DSA ports */
ret = dsa_cpu_dsa_setups(ds, parent); ret = dsa_cpu_dsa_setups(ds);
if (ret < 0) if (ret < 0)
netdev_err(master, "[%d] : can't configure CPU and DSA ports\n", netdev_err(master, "[%d] : can't configure CPU and DSA ports\n",
index); index);
...@@ -252,7 +252,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, struct net_device *master, ...@@ -252,7 +252,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, struct net_device *master,
ds->ops = ops; ds->ops = ops;
ds->priv = priv; ds->priv = priv;
ret = dsa_switch_setup_one(ds, master, parent); ret = dsa_switch_setup_one(ds, master);
if (ret) if (ret)
return ERR_PTR(ret); return ERR_PTR(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment