[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6214646.nAF6lzWV79@wuerfel>
Date: Wed, 08 Jan 2014 11:05:07 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Kishon Vijay Abraham I <kishon@...com>
Cc: Roger Quadros <rogerq@...com>, tj@...nel.org,
sergei.shtylyov@...entembedded.com, b.zolnierkie@...sung.com,
hdegoede@...hat.com, linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
Balaji T K <balajitk@...com>
Subject: Re: [PATCH v3 2/3] ata: ahci_platform: Manage SATA PHY
On Wednesday 08 January 2014 15:29:18 Kishon Vijay Abraham I wrote:
> > + hpriv->phy = devm_phy_get(dev, "sata-phy");
> > + if (IS_ERR(hpriv->phy)) {
> > + dev_dbg(dev, "can't get sata-phy\n");
> > + /* return only if -EPROBE_DEFER */
> > + if (PTR_ERR(hpriv->phy) == -EPROBE_DEFER) {
> > + rc = -EPROBE_DEFER;
> > + goto disable_unprepare_clk;
> > + }
> > + }
This should probably check for all errors except "not present"
rather than checking for -EPROBE_DEFER. We want to abort the
probe function for deferred probe as well as the case where we
a PHY was listed but isn't working properly.
> > + if (!IS_ERR(hpriv->phy)) {
> > + phy_init(hpriv->phy);
>
> Don't we have to check the return values of phy_init and phy_power_on? Is it
> not needed because it is an optional phy?
Right. I think we should set hpriv->phy to NULL if it's not there and
then call the functions only if it's actually present but bail out on
an error.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists