summaryrefslogtreecommitdiff
path: root/drivers/net/phy/sfp-bus.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-05-28 12:57:34 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-31 22:37:46 +0300
commit320587e6eac960591077b90271f40bfad24d6155 (patch)
tree98c4d0807d56a6ef1870c7bb2bfa52e5ade09fdf /drivers/net/phy/sfp-bus.c
parentcdea04c24616416f8239d86a1012d924fb6f0d30 (diff)
downloadlinux-320587e6eac960591077b90271f40bfad24d6155.tar.xz
net: sfp: add mandatory attach/detach methods for sfp buses
Add attach and detach methods for SFP buses, which will allow us to get rid of the netdev storage in sfp-bus. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/sfp-bus.c')
-rw-r--r--drivers/net/phy/sfp-bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index e9c187946cca..0608203cc752 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -351,7 +351,7 @@ static int sfp_register_bus(struct sfp_bus *bus)
bus->socket_ops->attach(bus->sfp);
if (bus->started)
bus->socket_ops->start(bus->sfp);
- bus->netdev->sfp_bus = bus;
+ bus->upstream_ops->attach(bus->upstream, bus);
bus->registered = true;
return 0;
}
@@ -360,8 +360,8 @@ static void sfp_unregister_bus(struct sfp_bus *bus)
{
const struct sfp_upstream_ops *ops = bus->upstream_ops;
- bus->netdev->sfp_bus = NULL;
if (bus->registered) {
+ bus->upstream_ops->detach(bus->upstream, bus);
if (bus->started)
bus->socket_ops->stop(bus->sfp);
bus->socket_ops->detach(bus->sfp);