1 From cafbb70e148e7a4e318dcc1e36a96643815b6245 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Mon, 3 Apr 2023 02:17:19 +0100
4 Subject: [PATCH 03/48] net: dsa: mt7530: make some noise if register read
7 Simply returning the negative error value instead of the read value
8 doesn't seem like a good idea. Return 0 instead and add WARN_ON_ONCE(1)
9 so this kind of error will not go unnoticed.
11 Suggested-by: Andrew Lunn <andrew@lunn.ch>
12 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
13 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
16 drivers/net/dsa/mt7530.c | 3 ++-
17 1 file changed, 2 insertions(+), 1 deletion(-)
19 --- a/drivers/net/dsa/mt7530.c
20 +++ b/drivers/net/dsa/mt7530.c
21 @@ -224,9 +224,10 @@ mt7530_mii_read(struct mt7530_priv *priv
22 /* MT7530 uses 31 as the pseudo port */
23 ret = bus->write(bus, 0x1f, 0x1f, page);
27 "failed to read mt7530 register\n");
32 lo = bus->read(bus, 0x1f, r);