@@ -162,7 +162,7 @@ static int kszphy_ack_interrupt(struct phy_device *phydev)
162
162
static int kszphy_config_intr (struct phy_device * phydev )
163
163
{
164
164
const struct kszphy_type * type = phydev -> drv -> driver_data ;
165
- int temp ;
165
+ int temp , err ;
166
166
u16 mask ;
167
167
168
168
if (type && type -> interrupt_level_mask )
@@ -178,12 +178,23 @@ static int kszphy_config_intr(struct phy_device *phydev)
178
178
phy_write (phydev , MII_KSZPHY_CTRL , temp );
179
179
180
180
/* enable / disable interrupts */
181
- if (phydev -> interrupts == PHY_INTERRUPT_ENABLED )
181
+ if (phydev -> interrupts == PHY_INTERRUPT_ENABLED ) {
182
+ err = kszphy_ack_interrupt (phydev );
183
+ if (err )
184
+ return err ;
185
+
182
186
temp = KSZPHY_INTCS_ALL ;
183
- else
187
+ err = phy_write (phydev , MII_KSZPHY_INTCS , temp );
188
+ } else {
184
189
temp = 0 ;
190
+ err = phy_write (phydev , MII_KSZPHY_INTCS , temp );
191
+ if (err )
192
+ return err ;
193
+
194
+ err = kszphy_ack_interrupt (phydev );
195
+ }
185
196
186
- return phy_write ( phydev , MII_KSZPHY_INTCS , temp ) ;
197
+ return err ;
187
198
}
188
199
189
200
static irqreturn_t kszphy_handle_interrupt (struct phy_device * phydev )
@@ -1182,7 +1193,6 @@ static struct phy_driver ksphy_driver[] = {
1182
1193
/* PHY_BASIC_FEATURES */
1183
1194
.driver_data = & ks8737_type ,
1184
1195
.config_init = kszphy_config_init ,
1185
- .ack_interrupt = kszphy_ack_interrupt ,
1186
1196
.config_intr = kszphy_config_intr ,
1187
1197
.handle_interrupt = kszphy_handle_interrupt ,
1188
1198
.suspend = genphy_suspend ,
@@ -1195,7 +1205,6 @@ static struct phy_driver ksphy_driver[] = {
1195
1205
.driver_data = & ksz8021_type ,
1196
1206
.probe = kszphy_probe ,
1197
1207
.config_init = kszphy_config_init ,
1198
- .ack_interrupt = kszphy_ack_interrupt ,
1199
1208
.config_intr = kszphy_config_intr ,
1200
1209
.handle_interrupt = kszphy_handle_interrupt ,
1201
1210
.get_sset_count = kszphy_get_sset_count ,
@@ -1211,7 +1220,6 @@ static struct phy_driver ksphy_driver[] = {
1211
1220
.driver_data = & ksz8021_type ,
1212
1221
.probe = kszphy_probe ,
1213
1222
.config_init = kszphy_config_init ,
1214
- .ack_interrupt = kszphy_ack_interrupt ,
1215
1223
.config_intr = kszphy_config_intr ,
1216
1224
.handle_interrupt = kszphy_handle_interrupt ,
1217
1225
.get_sset_count = kszphy_get_sset_count ,
@@ -1228,7 +1236,6 @@ static struct phy_driver ksphy_driver[] = {
1228
1236
.probe = kszphy_probe ,
1229
1237
.config_init = ksz8041_config_init ,
1230
1238
.config_aneg = ksz8041_config_aneg ,
1231
- .ack_interrupt = kszphy_ack_interrupt ,
1232
1239
.config_intr = kszphy_config_intr ,
1233
1240
.handle_interrupt = kszphy_handle_interrupt ,
1234
1241
.get_sset_count = kszphy_get_sset_count ,
@@ -1244,7 +1251,6 @@ static struct phy_driver ksphy_driver[] = {
1244
1251
.driver_data = & ksz8041_type ,
1245
1252
.probe = kszphy_probe ,
1246
1253
.config_init = kszphy_config_init ,
1247
- .ack_interrupt = kszphy_ack_interrupt ,
1248
1254
.config_intr = kszphy_config_intr ,
1249
1255
.handle_interrupt = kszphy_handle_interrupt ,
1250
1256
.get_sset_count = kszphy_get_sset_count ,
@@ -1258,7 +1264,6 @@ static struct phy_driver ksphy_driver[] = {
1258
1264
.driver_data = & ksz8051_type ,
1259
1265
.probe = kszphy_probe ,
1260
1266
.config_init = kszphy_config_init ,
1261
- .ack_interrupt = kszphy_ack_interrupt ,
1262
1267
.config_intr = kszphy_config_intr ,
1263
1268
.handle_interrupt = kszphy_handle_interrupt ,
1264
1269
.get_sset_count = kszphy_get_sset_count ,
@@ -1275,7 +1280,6 @@ static struct phy_driver ksphy_driver[] = {
1275
1280
.driver_data = & ksz8041_type ,
1276
1281
.probe = kszphy_probe ,
1277
1282
.config_init = kszphy_config_init ,
1278
- .ack_interrupt = kszphy_ack_interrupt ,
1279
1283
.config_intr = kszphy_config_intr ,
1280
1284
.handle_interrupt = kszphy_handle_interrupt ,
1281
1285
.get_sset_count = kszphy_get_sset_count ,
@@ -1291,7 +1295,6 @@ static struct phy_driver ksphy_driver[] = {
1291
1295
.driver_data = & ksz8081_type ,
1292
1296
.probe = kszphy_probe ,
1293
1297
.config_init = ksz8081_config_init ,
1294
- .ack_interrupt = kszphy_ack_interrupt ,
1295
1298
.config_intr = kszphy_config_intr ,
1296
1299
.handle_interrupt = kszphy_handle_interrupt ,
1297
1300
.get_sset_count = kszphy_get_sset_count ,
@@ -1305,7 +1308,6 @@ static struct phy_driver ksphy_driver[] = {
1305
1308
.phy_id_mask = MICREL_PHY_ID_MASK ,
1306
1309
/* PHY_BASIC_FEATURES */
1307
1310
.config_init = ksz8061_config_init ,
1308
- .ack_interrupt = kszphy_ack_interrupt ,
1309
1311
.config_intr = kszphy_config_intr ,
1310
1312
.handle_interrupt = kszphy_handle_interrupt ,
1311
1313
.suspend = genphy_suspend ,
@@ -1319,7 +1321,6 @@ static struct phy_driver ksphy_driver[] = {
1319
1321
.probe = kszphy_probe ,
1320
1322
.get_features = ksz9031_get_features ,
1321
1323
.config_init = ksz9021_config_init ,
1322
- .ack_interrupt = kszphy_ack_interrupt ,
1323
1324
.config_intr = kszphy_config_intr ,
1324
1325
.handle_interrupt = kszphy_handle_interrupt ,
1325
1326
.get_sset_count = kszphy_get_sset_count ,
@@ -1339,7 +1340,6 @@ static struct phy_driver ksphy_driver[] = {
1339
1340
.config_init = ksz9031_config_init ,
1340
1341
.soft_reset = genphy_soft_reset ,
1341
1342
.read_status = ksz9031_read_status ,
1342
- .ack_interrupt = kszphy_ack_interrupt ,
1343
1343
.config_intr = kszphy_config_intr ,
1344
1344
.handle_interrupt = kszphy_handle_interrupt ,
1345
1345
.get_sset_count = kszphy_get_sset_count ,
@@ -1369,7 +1369,6 @@ static struct phy_driver ksphy_driver[] = {
1369
1369
.probe = kszphy_probe ,
1370
1370
.config_init = ksz9131_config_init ,
1371
1371
.read_status = genphy_read_status ,
1372
- .ack_interrupt = kszphy_ack_interrupt ,
1373
1372
.config_intr = kszphy_config_intr ,
1374
1373
.handle_interrupt = kszphy_handle_interrupt ,
1375
1374
.get_sset_count = kszphy_get_sset_count ,
0 commit comments