1 From a7091ef24223ed39b39c6b73b77c55c8a607f34a Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@arm.linux.org.uk>
3 Date: Thu, 8 Oct 2015 23:49:47 +0100
4 Subject: [PATCH 734/744] sfp/phylink: hook up eeprom functions
6 Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
8 drivers/net/phy/sfp.c | 19 +++++++++++--------
9 1 file changed, 11 insertions(+), 8 deletions(-)
11 --- a/drivers/net/phy/sfp.c
12 +++ b/drivers/net/phy/sfp.c
13 @@ -901,11 +901,9 @@ static void sfp_sm_event(struct sfp *sfp
14 mutex_unlock(&sfp->sm_mutex);
18 -static int sfp_phy_module_info(struct phy_device *phy,
19 - struct ethtool_modinfo *modinfo)
20 +static int sfp_module_info(void *priv, struct ethtool_modinfo *modinfo)
22 - struct sfp *sfp = phy->priv;
23 + struct sfp *sfp = priv;
25 /* locking... and check module is present */
27 @@ -919,10 +917,9 @@ static int sfp_phy_module_info(struct ph
31 -static int sfp_phy_module_eeprom(struct phy_device *phy,
32 - struct ethtool_eeprom *ee, u8 *data)
33 +static int sfp_module_eeprom(void *priv, struct ethtool_eeprom *ee, u8 *data)
35 - struct sfp *sfp = phy->priv;
36 + struct sfp *sfp = priv;
37 unsigned int first, last, len;
40 @@ -953,7 +950,11 @@ static int sfp_phy_module_eeprom(struct
46 +static const struct phylink_module_ops sfp_module_ops = {
47 + .get_module_info = sfp_module_info,
48 + .get_module_eeprom = sfp_module_eeprom,
51 static void sfp_timeout(struct work_struct *work)
53 @@ -1029,6 +1030,7 @@ static int sfp_netdev_notify(struct noti
54 case NETDEV_UNREGISTER:
55 if (sfp->mod_phy && sfp->phylink)
56 phylink_disconnect_phy(sfp->phylink);
57 + phylink_unregister_module(sfp->phylink, sfp);
61 @@ -1145,6 +1147,7 @@ static int sfp_probe(struct platform_dev
64 phylink_disable(sfp->phylink);
65 + phylink_register_module(sfp->phylink, sfp, &sfp_module_ops);
68 sfp->state = sfp_get_state(sfp);