mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] net: phy: fixed-link: read link parameters from devicetree
Date: Mon, 8 Aug 2016 14:17:25 +0300	[thread overview]
Message-ID: <20160808141725.887e9032d0928dd67e5166fd@gmail.com> (raw)
In-Reply-To: <1470654177-29951-1-git-send-email-l.stach@pengutronix.de>

On Mon,  8 Aug 2016 13:02:57 +0200
Lucas Stach <l.stach@pengutronix.de> wrote:

> Implement the missing reading of the fixed link parameters from
> the devicetree properties.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/net/phy/phy.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 13b832470926..fc39c5d8c750 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -309,11 +309,14 @@ static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
>  
>  	phydev->dev.parent = &edev->dev;
>  	phydev->registered = 1;
> -	phydev->speed = 1000;
> -	phydev->duplex = 1;
> -	phydev->pause = phydev->asym_pause = 0;
>  	phydev->link = 1;
>  
> +	if (of_property_read_u32(np, "speed", &phydev->speed))
> +		return NULL;
> +	phydev->duplex = of_property_read_bool(np,"full-duplex");
                                                ^^^^
                                                  please fix coding style here.
> +	phydev->pause = of_property_read_bool(np, "pause");
> +	phydev->asym_pause = of_property_read_bool(np, "asym-pause");
> +
>  	return phydev;
>  }
>  
> -- 
> 2.8.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov

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

  reply	other threads:[~2016-08-08 11:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 11:02 Lucas Stach
2016-08-08 11:17 ` Antony Pavlov [this message]
2018-02-06  7:54 Sascha Hauer

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=20160808141725.887e9032d0928dd67e5166fd@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.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