Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [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	[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, back to index

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

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git