1 From b7c818d194927bdc60ed15db55bb8654496a36b7 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Fri, 14 May 2021 22:59:58 +0200
4 Subject: [PATCH] net: dsa: qca8k: handle error from qca8k_busy_wait
6 Propagate errors from qca8k_busy_wait instead of hardcoding return
9 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
10 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 drivers/net/dsa/qca8k.c | 21 +++++++++++++--------
14 1 file changed, 13 insertions(+), 8 deletions(-)
16 --- a/drivers/net/dsa/qca8k.c
17 +++ b/drivers/net/dsa/qca8k.c
18 @@ -388,8 +388,9 @@ qca8k_fdb_access(struct qca8k_priv *priv
21 /* wait for completion */
22 - if (qca8k_busy_wait(priv, QCA8K_REG_ATU_FUNC, QCA8K_ATU_FUNC_BUSY))
24 + ret = qca8k_busy_wait(priv, QCA8K_REG_ATU_FUNC, QCA8K_ATU_FUNC_BUSY);
28 /* Check for table full violation when adding an entry */
29 if (cmd == QCA8K_FDB_LOAD) {
30 @@ -468,8 +469,9 @@ qca8k_vlan_access(struct qca8k_priv *pri
33 /* wait for completion */
34 - if (qca8k_busy_wait(priv, QCA8K_REG_VTU_FUNC1, QCA8K_VTU_FUNC1_BUSY))
36 + ret = qca8k_busy_wait(priv, QCA8K_REG_VTU_FUNC1, QCA8K_VTU_FUNC1_BUSY);
40 /* Check for table full violation when adding an entry */
41 if (cmd == QCA8K_VLAN_LOAD) {
42 @@ -580,7 +582,9 @@ qca8k_mib_init(struct qca8k_priv *priv)
46 - qca8k_busy_wait(priv, QCA8K_REG_MIB, QCA8K_MIB_BUSY);
47 + ret = qca8k_busy_wait(priv, QCA8K_REG_MIB, QCA8K_MIB_BUSY);
51 ret = qca8k_reg_set(priv, QCA8K_REG_MIB, QCA8K_MIB_CPU_KEEP);
53 @@ -670,9 +674,10 @@ qca8k_mdio_read(struct qca8k_priv *priv,
57 - if (qca8k_busy_wait(priv, QCA8K_MDIO_MASTER_CTRL,
58 - QCA8K_MDIO_MASTER_BUSY))
60 + ret = qca8k_busy_wait(priv, QCA8K_MDIO_MASTER_CTRL,
61 + QCA8K_MDIO_MASTER_BUSY);
65 val = qca8k_read(priv, QCA8K_MDIO_MASTER_CTRL);