diff options
author | Andrew Lunn <andrew@lunn.ch> | 2016-06-04 15:17:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-04 17:29:55 -0400 |
commit | 83c0afaec7b730b16c518aecc8e6246ec91b265e (patch) | |
tree | 5d675d5517efb9532cb4154ae982a3d3ecb2798e /drivers/net/dsa | |
parent | b516d453239551d7916d5e35bc68823ed5b55f98 (diff) |
net: dsa: Add new binding implementation
The existing DSA binding has a number of limitations and problems. The
main problem is that it cannot represent a switch as a linux device,
hanging off some bus. It is limited to one CPU port. The DSA platform
device is artificial, and does not really represent hardware.
Implement a new binding which can be embedded into any type of node on
a bus to represent one switch device, and its links to other switches.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 192b39cbdbcd..ee06055444f9 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -3748,6 +3748,12 @@ int mv88e6xxx_probe(struct mdio_device *mdiodev) | |||
3748 | 3748 | ||
3749 | dev_set_drvdata(dev, ds); | 3749 | dev_set_drvdata(dev, ds); |
3750 | 3750 | ||
3751 | err = dsa_register_switch(ds, mdiodev->dev.of_node); | ||
3752 | if (err) { | ||
3753 | mv88e6xxx_mdio_unregister(ps); | ||
3754 | return err; | ||
3755 | } | ||
3756 | |||
3751 | dev_info(dev, "switch 0x%x probed: %s, revision %u\n", | 3757 | dev_info(dev, "switch 0x%x probed: %s, revision %u\n", |
3752 | prod_num, ps->info->name, rev); | 3758 | prod_num, ps->info->name, rev); |
3753 | 3759 | ||
@@ -3759,6 +3765,7 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev) | |||
3759 | struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); | 3765 | struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); |
3760 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 3766 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
3761 | 3767 | ||
3768 | dsa_unregister_switch(ds); | ||
3762 | put_device(&ps->bus->dev); | 3769 | put_device(&ps->bus->dev); |
3763 | 3770 | ||
3764 | mv88e6xxx_mdio_unregister(ps); | 3771 | mv88e6xxx_mdio_unregister(ps); |