The MIB clear in yt921x_chip_setup() is redundant: it runs right after
hard reset of the hardware, which already zeroes MIB counters.
It did not execute the right procedure either: ALL_PORT must be lifted
from latched value before CLEAN is fired. It works only because the
reset lifts the MIB control register (and counters altogether).
Nor should we take care of it elsewhere: .port_setup() should not clear
it, and .setup() runs at most once per registration, so per-port state
is always freshly allocated by .port_setup().
Signed-off-by: David Yang <mmyangfl@gmail.com>
---
drivers/net/dsa/motorcomm/chip.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index 980d066a4bea..43e8af90ffc9 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -3996,12 +3996,6 @@ static int yt921x_chip_setup(struct yt921x_priv *priv)
return res;
#endif
- /* Clear MIB */
- ctrl = YT921X_MIB_CTRL_CLEAN | YT921X_MIB_CTRL_ALL_PORT;
- res = yt921x_reg_write(priv, YT921X_MIB_CTRL, ctrl);
- if (res)
- return res;
-
/* Miscellaneous */
res = yt921x_reg_set_bits(priv, YT921X_SENSOR, YT921X_SENSOR_TEMP);
if (res)
--
2.53.0