Thread (13 messages) 13 messages, 4 authors, 2014-01-09

Re: [PATCH v3 2/3] ata: ahci_platform: Manage SATA PHY

flat view

From: Arnd Bergmann <arnd@arndb.de>
Date: 2014-01-08 11:46:19
Also in: linux-devicetree, lkml

On Wednesday 08 January 2014 16:58:15 Roger Quadros wrote:
hpriv->phy = devm_phy_get(dev, "sata-phy");
if (IS_ERR(hpriv->phy)) {
        if (PTR_ERR(hpriv->phy) == -ENODEV)
                goto continue;

        dev_err(dev, "couldn't get sata-phy\n");
        rc = PTR_ERR(hpriv->phy);
        goto disable_unprepare_clk;
}

continue:

if (!IS_ERR(hpriv->phy)) {
        rc = phy_init(hpriv->phy);
        if (rc)
                goto disable_unprepare_clk;

        rc = phy_power_on(hpriv->phy);
        if (rc) {
                phy_exit(hpriv->phy);
                goto disable_unprepare_clk;
        }
}
As I said, I'd prefer to set hpriv->phy to NULL in case of -ENODEV,
but functionally it seems right (with the fixup from your other mail).

One more comment: you shouldn't print an error message before
returning -EPROBE_DEFER, so if you want to keep that message,
you have to check for that return value after all.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help