lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5878159.3LjUeZKdYB@wuerfel>
Date:	Wed, 08 Jan 2014 12:46:09 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Roger Quadros <rogerq@...com>
Cc:	Kishon Vijay Abraham I <kishon@...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 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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ