* [PATCH net-next] net: dsa: felix: Don't error out on disabled ports with no phy-mode
@ 2020-01-16 18:34 Vladimir Oltean
2020-01-16 20:50 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2020-01-16 18:34 UTC (permalink / raw)
To: davem, netdev, linux
Cc: andrew, f.fainelli, vivien.didelot, claudiu.manoil,
alexandru.marginean, Vladimir Oltean
From: Vladimir Oltean <vladimir.oltean@nxp.com>
The felix_parse_ports_node function was tested only on device trees
where all ports were enabled. Fix this check so that the driver
continues to probe only with the ports where status is not "disabled",
as expected.
Fixes: bdeced75b13f ("net: dsa: felix: Add PCS operations for PHYLINK")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/dsa/ocelot/felix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index feccb6201660..d6ee089dbfe1 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -328,6 +328,9 @@ static int felix_parse_ports_node(struct felix *felix,
u32 port;
int err;
+ if (!of_device_is_available(child))
+ continue;
+
/* Get switch port number from DT */
if (of_property_read_u32(child, "reg", &port) < 0) {
dev_err(dev, "Port number not defined in device tree "
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: dsa: felix: Don't error out on disabled ports with no phy-mode
2020-01-16 18:34 [PATCH net-next] net: dsa: felix: Don't error out on disabled ports with no phy-mode Vladimir Oltean
@ 2020-01-16 20:50 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2020-01-16 20:50 UTC (permalink / raw)
To: Vladimir Oltean
Cc: davem, netdev, linux, f.fainelli, vivien.didelot, claudiu.manoil,
alexandru.marginean, Vladimir Oltean
On Thu, Jan 16, 2020 at 08:34:49PM +0200, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> The felix_parse_ports_node function was tested only on device trees
> where all ports were enabled. Fix this check so that the driver
> continues to probe only with the ports where status is not "disabled",
> as expected.
>
> Fixes: bdeced75b13f ("net: dsa: felix: Add PCS operations for PHYLINK")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> drivers/net/dsa/ocelot/felix.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
> index feccb6201660..d6ee089dbfe1 100644
> --- a/drivers/net/dsa/ocelot/felix.c
> +++ b/drivers/net/dsa/ocelot/felix.c
> @@ -328,6 +328,9 @@ static int felix_parse_ports_node(struct felix *felix,
> u32 port;
> int err;
>
> + if (!of_device_is_available(child))
> + continue;
> +
Hi Vladimir
for_each_available_child_of_node() is i think a better fix.
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-16 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 18:34 [PATCH net-next] net: dsa: felix: Don't error out on disabled ports with no phy-mode Vladimir Oltean
2020-01-16 20:50 ` Andrew Lunn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.