Commit 54f70b3b authored by Russell King's avatar Russell King Committed by David S. Miller

net: sfp: remove sfp-bus use of netdevs

The sfp-bus code now no longer has any use for the network device
structure, so remove its use.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 320587e6
...@@ -565,8 +565,7 @@ static int phylink_register_sfp(struct phylink *pl, ...@@ -565,8 +565,7 @@ static int phylink_register_sfp(struct phylink *pl,
return ret; return ret;
} }
pl->sfp_bus = sfp_register_upstream(ref.fwnode, pl->netdev, pl, pl->sfp_bus = sfp_register_upstream(ref.fwnode, pl, &sfp_phylink_ops);
&sfp_phylink_ops);
if (!pl->sfp_bus) if (!pl->sfp_bus)
return -ENOMEM; return -ENOMEM;
......
...@@ -24,7 +24,6 @@ struct sfp_bus { ...@@ -24,7 +24,6 @@ struct sfp_bus {
const struct sfp_upstream_ops *upstream_ops; const struct sfp_upstream_ops *upstream_ops;
void *upstream; void *upstream;
struct net_device *netdev;
struct phy_device *phydev; struct phy_device *phydev;
bool registered; bool registered;
...@@ -443,13 +442,11 @@ static void sfp_upstream_clear(struct sfp_bus *bus) ...@@ -443,13 +442,11 @@ static void sfp_upstream_clear(struct sfp_bus *bus)
{ {
bus->upstream_ops = NULL; bus->upstream_ops = NULL;
bus->upstream = NULL; bus->upstream = NULL;
bus->netdev = NULL;
} }
/** /**
* sfp_register_upstream() - Register the neighbouring device * sfp_register_upstream() - Register the neighbouring device
* @fwnode: firmware node for the SFP bus * @fwnode: firmware node for the SFP bus
* @ndev: network device associated with the interface
* @upstream: the upstream private data * @upstream: the upstream private data
* @ops: the upstream's &struct sfp_upstream_ops * @ops: the upstream's &struct sfp_upstream_ops
* *
...@@ -460,7 +457,7 @@ static void sfp_upstream_clear(struct sfp_bus *bus) ...@@ -460,7 +457,7 @@ static void sfp_upstream_clear(struct sfp_bus *bus)
* On error, returns %NULL. * On error, returns %NULL.
*/ */
struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode, struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode,
struct net_device *ndev, void *upstream, void *upstream,
const struct sfp_upstream_ops *ops) const struct sfp_upstream_ops *ops)
{ {
struct sfp_bus *bus = sfp_bus_get(fwnode); struct sfp_bus *bus = sfp_bus_get(fwnode);
...@@ -470,7 +467,6 @@ struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode, ...@@ -470,7 +467,6 @@ struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode,
rtnl_lock(); rtnl_lock();
bus->upstream_ops = ops; bus->upstream_ops = ops;
bus->upstream = upstream; bus->upstream = upstream;
bus->netdev = ndev;
if (bus->sfp) { if (bus->sfp) {
ret = sfp_register_bus(bus); ret = sfp_register_bus(bus);
...@@ -592,7 +588,7 @@ struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp, ...@@ -592,7 +588,7 @@ struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp,
bus->sfp = sfp; bus->sfp = sfp;
bus->socket_ops = ops; bus->socket_ops = ops;
if (bus->netdev) { if (bus->upstream_ops) {
ret = sfp_register_bus(bus); ret = sfp_register_bus(bus);
if (ret) if (ret)
sfp_socket_clear(bus); sfp_socket_clear(bus);
...@@ -612,7 +608,7 @@ EXPORT_SYMBOL_GPL(sfp_register_socket); ...@@ -612,7 +608,7 @@ EXPORT_SYMBOL_GPL(sfp_register_socket);
void sfp_unregister_socket(struct sfp_bus *bus) void sfp_unregister_socket(struct sfp_bus *bus)
{ {
rtnl_lock(); rtnl_lock();
if (bus->netdev) if (bus->upstream_ops)
sfp_unregister_bus(bus); sfp_unregister_bus(bus);
sfp_socket_clear(bus); sfp_socket_clear(bus);
rtnl_unlock(); rtnl_unlock();
......
...@@ -464,7 +464,6 @@ enum { ...@@ -464,7 +464,6 @@ enum {
struct fwnode_handle; struct fwnode_handle;
struct ethtool_eeprom; struct ethtool_eeprom;
struct ethtool_modinfo; struct ethtool_modinfo;
struct net_device;
struct sfp_bus; struct sfp_bus;
/** /**
...@@ -510,7 +509,7 @@ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee, ...@@ -510,7 +509,7 @@ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
void sfp_upstream_start(struct sfp_bus *bus); void sfp_upstream_start(struct sfp_bus *bus);
void sfp_upstream_stop(struct sfp_bus *bus); void sfp_upstream_stop(struct sfp_bus *bus);
struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode, struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode,
struct net_device *ndev, void *upstream, void *upstream,
const struct sfp_upstream_ops *ops); const struct sfp_upstream_ops *ops);
void sfp_unregister_upstream(struct sfp_bus *bus); void sfp_unregister_upstream(struct sfp_bus *bus);
#else #else
...@@ -555,8 +554,7 @@ static inline void sfp_upstream_stop(struct sfp_bus *bus) ...@@ -555,8 +554,7 @@ static inline void sfp_upstream_stop(struct sfp_bus *bus)
} }
static inline struct sfp_bus *sfp_register_upstream( static inline struct sfp_bus *sfp_register_upstream(
struct fwnode_handle *fwnode, struct fwnode_handle *fwnode, void *upstream,
struct net_device *ndev, void *upstream,
const struct sfp_upstream_ops *ops) const struct sfp_upstream_ops *ops)
{ {
return (struct sfp_bus *)-1; return (struct sfp_bus *)-1;
......
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