From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Florian Fainelli <f.fainelli@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH 04/10] net: phy: add genphy_aneg_done()
Date: Wed, 12 Feb 2014 18:43:38 +0400 [thread overview]
Message-ID: <52FB889A.4000207@cogentembedded.com> (raw)
In-Reply-To: <1392168462-18888-5-git-send-email-f.fainelli@gmail.com>
Hello.
On 12-02-2014 5:27, Florian Fainelli wrote:
> In preparation for allowing PHY drivers to potentially override their
> auto-negotiation done callback, move the contents of phy_aneg_done() to
> genphy_aneg_done() since that function really is the generic
> implementation based on the BMSR_ANEGCOMPLETE status.
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
[...]
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 82514e7..4e7db72 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -865,6 +865,22 @@ int genphy_config_aneg(struct phy_device *phydev)
> }
> EXPORT_SYMBOL(genphy_config_aneg);
>
> +/**
> + * genphy_aneg_done - return auto-negotiation status
> + * @phydev: target phy_device struct
> + *
> + * Description: Reads the status register and returns 0 either if
> + * auto-negotiation is incomplete, or if there was an error.
> + * Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
> + */
> +int genphy_aneg_done(struct phy_device *phydev)
> +{
> + int retval = phy_read(phydev, MII_BMSR);
> +
> + return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
I doubt parens are needed here.
WBR, Sergei
next prev parent reply other threads:[~2014-02-12 14:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 1:27 [PATCH 00/10] net: phy: small cleanups and improvements Florian Fainelli
2014-02-12 1:27 ` [PATCH 01/10] net: phy: use network device in phy_print_status Florian Fainelli
2014-02-13 0:13 ` David Miller
2014-02-13 0:20 ` Florian Fainelli
2014-02-13 0:22 ` David Miller
2014-02-12 1:27 ` [PATCH 02/10] net: phy: update phy_print_status to show pause settings Florian Fainelli
2014-02-12 1:27 ` [PATCH 03/10] net: phy: display human readable PHY speed settings Florian Fainelli
2014-02-12 1:27 ` [PATCH 04/10] net: phy: add genphy_aneg_done() Florian Fainelli
2014-02-12 14:43 ` Sergei Shtylyov [this message]
2014-02-12 1:27 ` [PATCH 05/10] net: phy: allow driver to implement their own aneg_done Florian Fainelli
2014-02-12 1:27 ` [PATCH 06/10] net: phy: fix phy_{clear,config}_interrupt comment typos Florian Fainelli
2014-02-12 1:27 ` [PATCH 07/10] net: phy: re-design phy_modes to be self-contained Florian Fainelli
2014-02-12 1:27 ` [PATCH 08/10] net: phy: expose PHY device interface mode Florian Fainelli
2014-02-12 1:27 ` [PATCH 09/10] net: phy: add "has_fixups" boolean property Florian Fainelli
2014-02-12 1:27 ` [PATCH 10/10] net: phy: expose phydev->has_fixups to sysfs Florian Fainelli
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=52FB889A.4000207@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).