diff options
Diffstat (limited to 'drivers/net/sfc/qt202x_phy.c')
-rw-r--r-- | drivers/net/sfc/qt202x_phy.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/sfc/qt202x_phy.c b/drivers/net/sfc/qt202x_phy.c index 3800fc791b2f..7450e3afbf4d 100644 --- a/drivers/net/sfc/qt202x_phy.c +++ b/drivers/net/sfc/qt202x_phy.c | |||
@@ -137,6 +137,14 @@ static int qt202x_reset_phy(struct efx_nic *efx) | |||
137 | 137 | ||
138 | static int qt202x_phy_probe(struct efx_nic *efx) | 138 | static int qt202x_phy_probe(struct efx_nic *efx) |
139 | { | 139 | { |
140 | struct qt202x_phy_data *phy_data; | ||
141 | |||
142 | phy_data = kzalloc(sizeof(struct qt202x_phy_data), GFP_KERNEL); | ||
143 | if (!phy_data) | ||
144 | return -ENOMEM; | ||
145 | efx->phy_data = phy_data; | ||
146 | phy_data->phy_mode = efx->phy_mode; | ||
147 | |||
140 | efx->mdio.mmds = QT202X_REQUIRED_DEVS; | 148 | efx->mdio.mmds = QT202X_REQUIRED_DEVS; |
141 | efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; | 149 | efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; |
142 | efx->loopback_modes = QT202X_LOOPBACKS | FALCON_XMAC_LOOPBACKS; | 150 | efx->loopback_modes = QT202X_LOOPBACKS | FALCON_XMAC_LOOPBACKS; |
@@ -145,7 +153,6 @@ static int qt202x_phy_probe(struct efx_nic *efx) | |||
145 | 153 | ||
146 | static int qt202x_phy_init(struct efx_nic *efx) | 154 | static int qt202x_phy_init(struct efx_nic *efx) |
147 | { | 155 | { |
148 | struct qt202x_phy_data *phy_data; | ||
149 | u32 devid; | 156 | u32 devid; |
150 | int rc; | 157 | int rc; |
151 | 158 | ||
@@ -155,17 +162,11 @@ static int qt202x_phy_init(struct efx_nic *efx) | |||
155 | return rc; | 162 | return rc; |
156 | } | 163 | } |
157 | 164 | ||
158 | phy_data = kzalloc(sizeof(struct qt202x_phy_data), GFP_KERNEL); | ||
159 | if (!phy_data) | ||
160 | return -ENOMEM; | ||
161 | efx->phy_data = phy_data; | ||
162 | |||
163 | devid = efx_mdio_read_id(efx, MDIO_MMD_PHYXS); | 165 | devid = efx_mdio_read_id(efx, MDIO_MMD_PHYXS); |
164 | EFX_INFO(efx, "PHY ID reg %x (OUI %06x model %02x revision %x)\n", | 166 | EFX_INFO(efx, "PHY ID reg %x (OUI %06x model %02x revision %x)\n", |
165 | devid, efx_mdio_id_oui(devid), efx_mdio_id_model(devid), | 167 | devid, efx_mdio_id_oui(devid), efx_mdio_id_model(devid), |
166 | efx_mdio_id_rev(devid)); | 168 | efx_mdio_id_rev(devid)); |
167 | 169 | ||
168 | phy_data->phy_mode = efx->phy_mode; | ||
169 | return 0; | 170 | return 0; |
170 | } | 171 | } |
171 | 172 | ||
@@ -224,7 +225,7 @@ static void qt202x_phy_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecm | |||
224 | mdio45_ethtool_gset(&efx->mdio, ecmd); | 225 | mdio45_ethtool_gset(&efx->mdio, ecmd); |
225 | } | 226 | } |
226 | 227 | ||
227 | static void qt202x_phy_fini(struct efx_nic *efx) | 228 | static void qt202x_phy_remove(struct efx_nic *efx) |
228 | { | 229 | { |
229 | /* Free the context block */ | 230 | /* Free the context block */ |
230 | kfree(efx->phy_data); | 231 | kfree(efx->phy_data); |
@@ -236,7 +237,8 @@ struct efx_phy_operations falcon_qt202x_phy_ops = { | |||
236 | .init = qt202x_phy_init, | 237 | .init = qt202x_phy_init, |
237 | .reconfigure = qt202x_phy_reconfigure, | 238 | .reconfigure = qt202x_phy_reconfigure, |
238 | .poll = qt202x_phy_poll, | 239 | .poll = qt202x_phy_poll, |
239 | .fini = qt202x_phy_fini, | 240 | .fini = efx_port_dummy_op_void, |
241 | .remove = qt202x_phy_remove, | ||
240 | .get_settings = qt202x_phy_get_settings, | 242 | .get_settings = qt202x_phy_get_settings, |
241 | .set_settings = efx_mdio_set_settings, | 243 | .set_settings = efx_mdio_set_settings, |
242 | }; | 244 | }; |