[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201205152814.7867-1-TheSven73@gmail.com>
Date: Sat, 5 Dec 2020 10:28:13 -0500
From: Sven Van Asbroeck <thesven73@...il.com>
To: Woojung Huh <woojung.huh@...rochip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
David S Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Sven Van Asbroeck <thesven73@...il.com>,
Helmut Grohne <helmut.grohne@...enta.de>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH net v1 1/2] net: dsa: microchip: fix devicetree parsing of cpu node
From: Sven Van Asbroeck <thesven73@...il.com>
On the ksz8795, if the devicetree contains a cpu node,
devicetree parsing fails and the whole driver errors out.
Fix the devicetree parsing code by making it use the
correct number of ports.
Fixes: 912aae27c6af ("net: dsa: microchip: really look for phy-mode in port nodes")
Tested-by: Sven Van Asbroeck <thesven73@...il.com> # ksz8795
Signed-off-by: Sven Van Asbroeck <thesven73@...il.com>
---
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git # 905b2032fa42
To: Woojung Huh <woojung.huh@...rochip.com>
To: Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>
To: Andrew Lunn <andrew@...n.ch>
To: Vivien Didelot <vivien.didelot@...il.com>
To: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <olteanv@...il.com>
To: "David S. Miller" <davem@...emloft.net>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Helmut Grohne <helmut.grohne@...enta.de>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index e5f047129b15..17b804c44c53 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -431,7 +431,7 @@ int ksz_switch_register(struct ksz_device *dev,
if (of_property_read_u32(port, "reg",
&port_num))
continue;
- if (port_num >= dev->port_cnt)
+ if (port_num >= dev->ds->num_ports)
return -EINVAL;
of_get_phy_mode(port,
&dev->ports[port_num].interface);
--
2.17.1
Powered by blists - more mailing lists