[PATCH 4/4] net: dsa: microchip: avoid hard-codded port count
From: Razvan Stefanescu
Date: Tue Aug 27 2019 - 05:31:37 EST
Use port_cnt value to disable interrupts on switch reset.
Signed-off-by: Razvan Stefanescu <razvan.stefanescu@xxxxxxxxxxxxx>
---
drivers/net/dsa/microchip/ksz9477.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index 187be42de5f1..54fc05595d48 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -213,7 +213,7 @@ static int ksz9477_reset_switch(struct ksz_device *dev)
/* disable interrupts */
ksz_write32(dev, REG_SW_INT_MASK__4, SWITCH_INT_MASK);
- ksz_write32(dev, REG_SW_PORT_INT_MASK__4, 0x7F);
+ ksz_write32(dev, REG_SW_PORT_INT_MASK__4, dev->port_cnt);
ksz_read32(dev, REG_SW_PORT_INT_STATUS__4, &data32);
/* set broadcast storm protection 10% rate */
--
2.20.1