mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andreas Schmidt <mail@schmidt-andreas.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] net: cpsw: fix probe with fixed-link
Date: Tue, 27 Feb 2018 09:41:11 +0100	[thread overview]
Message-ID: <20180227084111.2toplgwa42k5d55y@pengutronix.de> (raw)
In-Reply-To: <20180222221627.12750-1-mail@schmidt-andreas.de>

On Thu, Feb 22, 2018 at 11:16:27PM +0100, Andreas Schmidt wrote:
> While cpsw is probe dt, it accepts only slaves nodes with "phy_id" property.
> In case of fixed-link there are no "phy_id" property and probe would be failed.
> This patch avoid the failure due to missing "phy_id" in case of fixed-link.
> 
> Signed-off-by: Andreas Schmidt <mail@schmidt-andreas.de>
> ---
> 
> Changes since v1:
>   - rework after "[PATCH] net: cpsw: remove unnecessary mdiobus_scan()" patch was committed.
> 
> ---
>  drivers/net/cpsw.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
> index 928b97774..3d3939cfa 100644
> --- a/drivers/net/cpsw.c
> +++ b/drivers/net/cpsw.c
> @@ -1089,11 +1089,13 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
>  
>  		if (i < priv->num_slaves && !strncmp(child->name, "slave", 5)) {
>  			struct cpsw_slave *slave = &priv->slaves[i];
> -			uint32_t phy_id[2];
> +			uint32_t phy_id[2] = {-1, -1};
>  
> -			ret = of_property_read_u32_array(child, "phy_id", phy_id, 2);
> -			if (ret)
> -				return ret;
> +			if (!of_find_node_by_name(child, "fixed-link")) {
> +				ret = of_property_read_u32_array(child, "phy_id", phy_id, 2);
> +				if (ret)
> +					return ret;
> +			}
>  
>  			slave->dev.device_node = child;
>  			slave->phy_id = phy_id[1];
> -- 
> 2.14.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2018-02-27  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 21:48 [PATCH] " Andreas Schmidt
2018-02-16  7:42 ` Sascha Hauer
2018-02-22 22:16   ` [PATCH v2] " Andreas Schmidt
2018-02-27  8:41     ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180227084111.2toplgwa42k5d55y@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mail@schmidt-andreas.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox