From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: tj@kernel.org, kishon@ti.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH 3/3] ata: sata_mv: Fix probe failures with optional phys
Date: Sat, 1 Feb 2014 11:44:58 -0300 [thread overview]
Message-ID: <20140201144457.GA20358@localhost> (raw)
In-Reply-To: <1391264157-2112-3-git-send-email-andrew@lunn.ch>
On Sat, Feb 01, 2014 at 03:15:57PM +0100, Andrew Lunn wrote:
> Make use of devm_phy_optional() in order to fix probe failures on
> Armada 370, XP and others, when there is no phy driver available.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
> drivers/ata/sata_mv.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index eaa21eddbe70..26021cf077a8 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -4111,12 +4111,14 @@ static int mv_platform_probe(struct platform_device *pdev)
> clk_prepare_enable(hpriv->port_clks[port]);
>
> sprintf(port_number, "port%d", port);
> - hpriv->port_phys[port] = devm_phy_get(&pdev->dev, port_number);
> + hpriv->port_phys[port] = devm_phy_optional_get(&pdev->dev,
> + port_number);
> if (IS_ERR(hpriv->port_phys[port])) {
> rc = PTR_ERR(hpriv->port_phys[port]);
> hpriv->port_phys[port] = NULL;
> - if ((rc != -EPROBE_DEFER) && (rc != -ENODEV))
> - dev_warn(&pdev->dev, "error getting phy");
> + if (rc != -EPROBE_DEFER)
> + dev_warn(&pdev->dev, "error getting phy %d",
> + rc);
> goto err;
IMHO, this new series look much better. However, I still think the above code
is highly confusing (took me some time to see why you don't print the warning
on PROBE_DEFER, but do the goto in all cases).
Would it be too much to ask to add some comments to it? Your previous
explanation about why we need to fail on EPROBE_DEFER, to allow the phy
driver to load, was great. Adding some of that here would be nice.
I'll test this next week.
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-02-01 14:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0140131114857.GC26148@htj.dyndns.org>
2014-02-01 14:15 ` [PATCH 1/3] drivers: phy: Make NULL a valid phy reference Andrew Lunn
2014-02-01 14:15 ` [PATCH 2/3] drivers: phy: Add support for optional phys Andrew Lunn
2014-02-03 5:51 ` Kishon Vijay Abraham I
2014-02-03 9:36 ` Andrew Lunn
2014-02-03 10:19 ` Kishon Vijay Abraham I
2014-02-03 18:00 ` [patch v2 1/3] drivers: phy: Make NULL a valid phy reference Andrew Lunn
2014-02-03 18:00 ` [patch v2 2/3] drivers: phy: Add support for optional phys Andrew Lunn
2014-02-03 18:00 ` [patch v2 3/3] ata: sata_mv: Fix probe failures with " Andrew Lunn
2014-02-03 18:02 ` Tejun Heo
2014-02-03 19:04 ` Sergei Shtylyov
2014-02-03 18:17 ` [patch v3 " Andrew Lunn
2014-02-03 19:21 ` Sergei Shtylyov
2014-02-03 19:06 ` [patch v2 1/3] drivers: phy: Make NULL a valid phy reference Sergei Shtylyov
2014-02-03 18:13 ` Andrew Lunn
2014-02-03 19:17 ` Sergei Shtylyov
2014-02-03 21:15 ` Gregory CLEMENT
2014-02-01 14:15 ` [PATCH 3/3] ata: sata_mv: Fix probe failures with optional phys Andrew Lunn
2014-02-01 14:44 ` Ezequiel Garcia [this message]
2014-02-01 14:56 ` Andrew Lunn
2014-02-01 15:36 ` Ezequiel Garcia
2014-02-03 16:03 ` Tejun Heo
2014-02-03 16:20 ` Andrew Lunn
2014-02-03 16:21 ` Tejun Heo
2014-02-03 16:21 ` Gregory CLEMENT
2014-02-03 17:17 ` Gregory CLEMENT
2014-02-03 17:23 ` Andrew Lunn
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=20140201144457.GA20358@localhost \
--to=ezequiel.garcia@free-electrons.com \
--cc=andrew@lunn.ch \
--cc=kishon@ti.com \
--cc=linux-ide@vger.kernel.org \
--cc=tj@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).