@@ -212,11 +212,24 @@ static int xway_gphy_ack_interrupt(struct phy_device *phydev)
212
212
static int xway_gphy_config_intr (struct phy_device * phydev )
213
213
{
214
214
u16 mask = 0 ;
215
+ int err ;
216
+
217
+ if (phydev -> interrupts == PHY_INTERRUPT_ENABLED ) {
218
+ err = xway_gphy_ack_interrupt (phydev );
219
+ if (err )
220
+ return err ;
215
221
216
- if (phydev -> interrupts == PHY_INTERRUPT_ENABLED )
217
222
mask = XWAY_MDIO_INIT_MASK ;
223
+ err = phy_write (phydev , XWAY_MDIO_IMASK , mask );
224
+ } else {
225
+ err = phy_write (phydev , XWAY_MDIO_IMASK , mask );
226
+ if (err )
227
+ return err ;
228
+
229
+ err = xway_gphy_ack_interrupt (phydev );
230
+ }
218
231
219
- return phy_write ( phydev , XWAY_MDIO_IMASK , mask ) ;
232
+ return err ;
220
233
}
221
234
222
235
static irqreturn_t xway_gphy_handle_interrupt (struct phy_device * phydev )
@@ -245,7 +258,6 @@ static struct phy_driver xway_gphy[] = {
245
258
/* PHY_GBIT_FEATURES */
246
259
.config_init = xway_gphy_config_init ,
247
260
.config_aneg = xway_gphy14_config_aneg ,
248
- .ack_interrupt = xway_gphy_ack_interrupt ,
249
261
.handle_interrupt = xway_gphy_handle_interrupt ,
250
262
.config_intr = xway_gphy_config_intr ,
251
263
.suspend = genphy_suspend ,
@@ -257,7 +269,6 @@ static struct phy_driver xway_gphy[] = {
257
269
/* PHY_BASIC_FEATURES */
258
270
.config_init = xway_gphy_config_init ,
259
271
.config_aneg = xway_gphy14_config_aneg ,
260
- .ack_interrupt = xway_gphy_ack_interrupt ,
261
272
.handle_interrupt = xway_gphy_handle_interrupt ,
262
273
.config_intr = xway_gphy_config_intr ,
263
274
.suspend = genphy_suspend ,
@@ -269,7 +280,6 @@ static struct phy_driver xway_gphy[] = {
269
280
/* PHY_GBIT_FEATURES */
270
281
.config_init = xway_gphy_config_init ,
271
282
.config_aneg = xway_gphy14_config_aneg ,
272
- .ack_interrupt = xway_gphy_ack_interrupt ,
273
283
.handle_interrupt = xway_gphy_handle_interrupt ,
274
284
.config_intr = xway_gphy_config_intr ,
275
285
.suspend = genphy_suspend ,
@@ -281,7 +291,6 @@ static struct phy_driver xway_gphy[] = {
281
291
/* PHY_BASIC_FEATURES */
282
292
.config_init = xway_gphy_config_init ,
283
293
.config_aneg = xway_gphy14_config_aneg ,
284
- .ack_interrupt = xway_gphy_ack_interrupt ,
285
294
.handle_interrupt = xway_gphy_handle_interrupt ,
286
295
.config_intr = xway_gphy_config_intr ,
287
296
.suspend = genphy_suspend ,
@@ -292,7 +301,6 @@ static struct phy_driver xway_gphy[] = {
292
301
.name = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.5 / v1.6" ,
293
302
/* PHY_GBIT_FEATURES */
294
303
.config_init = xway_gphy_config_init ,
295
- .ack_interrupt = xway_gphy_ack_interrupt ,
296
304
.handle_interrupt = xway_gphy_handle_interrupt ,
297
305
.config_intr = xway_gphy_config_intr ,
298
306
.suspend = genphy_suspend ,
@@ -303,7 +311,6 @@ static struct phy_driver xway_gphy[] = {
303
311
.name = "Intel XWAY PHY22F (PEF 7061) v1.5 / v1.6" ,
304
312
/* PHY_BASIC_FEATURES */
305
313
.config_init = xway_gphy_config_init ,
306
- .ack_interrupt = xway_gphy_ack_interrupt ,
307
314
.handle_interrupt = xway_gphy_handle_interrupt ,
308
315
.config_intr = xway_gphy_config_intr ,
309
316
.suspend = genphy_suspend ,
@@ -314,7 +321,6 @@ static struct phy_driver xway_gphy[] = {
314
321
.name = "Intel XWAY PHY11G (xRX v1.1 integrated)" ,
315
322
/* PHY_GBIT_FEATURES */
316
323
.config_init = xway_gphy_config_init ,
317
- .ack_interrupt = xway_gphy_ack_interrupt ,
318
324
.handle_interrupt = xway_gphy_handle_interrupt ,
319
325
.config_intr = xway_gphy_config_intr ,
320
326
.suspend = genphy_suspend ,
@@ -325,7 +331,6 @@ static struct phy_driver xway_gphy[] = {
325
331
.name = "Intel XWAY PHY22F (xRX v1.1 integrated)" ,
326
332
/* PHY_BASIC_FEATURES */
327
333
.config_init = xway_gphy_config_init ,
328
- .ack_interrupt = xway_gphy_ack_interrupt ,
329
334
.handle_interrupt = xway_gphy_handle_interrupt ,
330
335
.config_intr = xway_gphy_config_intr ,
331
336
.suspend = genphy_suspend ,
@@ -336,7 +341,6 @@ static struct phy_driver xway_gphy[] = {
336
341
.name = "Intel XWAY PHY11G (xRX v1.2 integrated)" ,
337
342
/* PHY_GBIT_FEATURES */
338
343
.config_init = xway_gphy_config_init ,
339
- .ack_interrupt = xway_gphy_ack_interrupt ,
340
344
.handle_interrupt = xway_gphy_handle_interrupt ,
341
345
.config_intr = xway_gphy_config_intr ,
342
346
.suspend = genphy_suspend ,
@@ -347,7 +351,6 @@ static struct phy_driver xway_gphy[] = {
347
351
.name = "Intel XWAY PHY22F (xRX v1.2 integrated)" ,
348
352
/* PHY_BASIC_FEATURES */
349
353
.config_init = xway_gphy_config_init ,
350
- .ack_interrupt = xway_gphy_ack_interrupt ,
351
354
.handle_interrupt = xway_gphy_handle_interrupt ,
352
355
.config_intr = xway_gphy_config_intr ,
353
356
.suspend = genphy_suspend ,
0 commit comments