diff options
author | David S. Miller <davem@davemloft.net> | 2016-09-20 04:47:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-20 04:47:50 -0400 |
commit | 1860e688edc4ff4467863891baef73e6a32d9c7a (patch) | |
tree | 48a1a9fe0be3d7859393559dd8960782b78f4a77 /net/dsa/dsa.c | |
parent | f361bdde6124339aab599e45471c6aa79125d1a2 (diff) | |
parent | 8941ee36e3266a5efca52e32c4dc214f202c751a (diff) |
Merge branch 'dsa-set_addr-optional'
John Crispin says:
====================
net-next: dsa: set_addr should be optional
The Marvell driver is the only one that actually sets the switches HW
address. All other drivers have an empty stub. fix this by making the
callback optional.
====================
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 66e31acfcad8..a6902c1e2f28 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -378,9 +378,11 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) if (ret < 0) goto out; - ret = ops->set_addr(ds, dst->master_netdev->dev_addr); - if (ret < 0) - goto out; + if (ops->set_addr) { + ret = ops->set_addr(ds, dst->master_netdev->dev_addr); + if (ret < 0) + goto out; + } if (!ds->slave_mii_bus && ops->phy_read) { ds->slave_mii_bus = devm_mdiobus_alloc(parent); |