diff options
author | Arun Ramadoss <arun.ramadoss@microchip.com> | 2022-09-22 12:40:23 +0530 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-26 12:41:05 -0700 |
commit | 978f1f72460cb2dc742a35bae4de50b6b9ac653f (patch) | |
tree | 386df4e3ea72432b5fc467c2228e74be224e9001 /drivers/net/dsa/microchip/lan937x_main.c | |
parent | fc4f2fd02a1af919f79beaf406a8ef54327ff84b (diff) |
net: dsa: microchip: determine number of port irq based on switch type
Currently the number of port irqs is hard coded for the lan937x switch
as 6. In order to make the generic interrupt handler for ksz switches,
number of port irq supported by the switch is added to the
ksz_chip_data. It is 4 for ksz9477, 2 for ksz9897 and 3 for ksz9567.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/microchip/lan937x_main.c')
-rw-r--r-- | drivers/net/dsa/microchip/lan937x_main.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index cefe8517629a..fd5114a09463 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -20,8 +20,6 @@ #include "ksz_common.h" #include "lan937x.h" -#define LAN937x_PNIRQS 6 - static int lan937x_cfg(struct ksz_device *dev, u32 addr, u8 bits, bool set) { return regmap_update_bits(dev->regmap[0], addr, bits, set ? bits : 0); @@ -695,7 +693,7 @@ static int lan937x_pirq_setup(struct ksz_device *dev, u8 p) int ret, irq; int irq_num; - port->pirq.nirqs = LAN937x_PNIRQS; + port->pirq.nirqs = dev->info->port_nirqs; port->pirq.domain = irq_domain_add_simple(dev->dev->of_node, port->pirq.nirqs, 0, &lan937x_pirq_domain_ops, |