Skip to content

Commit 45a2005

Browse files
tlendackydavem330
authored andcommitted
amd-xgbe: Limit the I2C error messages that are output
When I2C communication fails, it tends to always fail. Rather than continuously issue an error message (once per second in most cases), change the message to be issued just once. Signed-off-by: Tom Lendacky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ed3333f commit 45a2005

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,8 @@ static int xgbe_phy_sfp_read_eeprom(struct xgbe_prv_data *pdata)
11211121

11221122
ret = xgbe_phy_sfp_get_mux(pdata);
11231123
if (ret) {
1124-
netdev_err(pdata->netdev, "I2C error setting SFP MUX\n");
1124+
dev_err_once(pdata->dev, "%s: I2C error setting SFP MUX\n",
1125+
netdev_name(pdata->netdev));
11251126
return ret;
11261127
}
11271128

@@ -1131,7 +1132,8 @@ static int xgbe_phy_sfp_read_eeprom(struct xgbe_prv_data *pdata)
11311132
&eeprom_addr, sizeof(eeprom_addr),
11321133
&sfp_eeprom, sizeof(sfp_eeprom));
11331134
if (ret) {
1134-
netdev_err(pdata->netdev, "I2C error reading SFP EEPROM\n");
1135+
dev_err_once(pdata->dev, "%s: I2C error reading SFP EEPROM\n",
1136+
netdev_name(pdata->netdev));
11351137
goto put;
11361138
}
11371139

@@ -1190,7 +1192,8 @@ static void xgbe_phy_sfp_signals(struct xgbe_prv_data *pdata)
11901192
&gpio_reg, sizeof(gpio_reg),
11911193
gpio_ports, sizeof(gpio_ports));
11921194
if (ret) {
1193-
netdev_err(pdata->netdev, "I2C error reading SFP GPIOs\n");
1195+
dev_err_once(pdata->dev, "%s: I2C error reading SFP GPIOs\n",
1196+
netdev_name(pdata->netdev));
11941197
return;
11951198
}
11961199

0 commit comments

Comments
 (0)