1 From: Russell King <rmk+kernel@arm.linux.org.uk>
2 Date: Thu, 8 Oct 2015 23:49:47 +0100
3 Subject: [PATCH] sfp/phylink: hook up eeprom functions
5 Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
8 --- a/drivers/net/phy/sfp.c
9 +++ b/drivers/net/phy/sfp.c
10 @@ -985,11 +985,9 @@ static void sfp_sm_event(struct sfp *sfp
11 mutex_unlock(&sfp->sm_mutex);
15 -static int sfp_phy_module_info(struct phy_device *phy,
16 - struct ethtool_modinfo *modinfo)
17 +static int sfp_module_info(void *priv, struct ethtool_modinfo *modinfo)
19 - struct sfp *sfp = phy->priv;
20 + struct sfp *sfp = priv;
22 /* locking... and check module is present */
24 @@ -1003,10 +1001,9 @@ static int sfp_phy_module_info(struct ph
28 -static int sfp_phy_module_eeprom(struct phy_device *phy,
29 - struct ethtool_eeprom *ee, u8 *data)
30 +static int sfp_module_eeprom(void *priv, struct ethtool_eeprom *ee, u8 *data)
32 - struct sfp *sfp = phy->priv;
33 + struct sfp *sfp = priv;
34 unsigned int first, last, len;
37 @@ -1037,7 +1034,11 @@ static int sfp_phy_module_eeprom(struct
43 +static const struct phylink_module_ops sfp_module_ops = {
44 + .get_module_info = sfp_module_info,
45 + .get_module_eeprom = sfp_module_eeprom,
48 static void sfp_timeout(struct work_struct *work)
50 @@ -1113,6 +1114,7 @@ static int sfp_netdev_notify(struct noti
51 case NETDEV_UNREGISTER:
52 if (sfp->mod_phy && sfp->phylink)
53 phylink_disconnect_phy(sfp->phylink);
54 + phylink_unregister_module(sfp->phylink, sfp);
58 @@ -1230,6 +1232,7 @@ static int sfp_probe(struct platform_dev
61 phylink_disable(sfp->phylink);
62 + phylink_register_module(sfp->phylink, sfp, &sfp_module_ops);
65 sfp->state = sfp_get_state(sfp);