diff mbox

[2/2] pinctrl: tegra-xusb: testing wrong variable in probe()

Message ID 20140731152308.GE31539@mwanda
State Superseded, archived
Headers show

Commit Message

Dan Carpenter July 31, 2014, 3:23 p.m. UTC
There is a cut and paste bug so we test the wrong variable.  "err" is
never less than zero at this point.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Thierry Reding July 31, 2014, 3:36 p.m. UTC | #1
On Thu, Jul 31, 2014 at 06:23:08PM +0300, Dan Carpenter wrote:
> There is a cut and paste bug so we test the wrong variable.  "err" is
> never less than zero at this point.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
> index 419a047..e641b42 100644
> --- a/drivers/pinctrl/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
> @@ -930,7 +930,8 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
>  
>  	padctl->provider = devm_of_phy_provider_register(&pdev->dev,
>  							 tegra_xusb_padctl_xlate);
> -	if (err < 0) {
> +	if (IS_ERR(padctl->provider)) {
> +		err = PTR_ERR(padctl->provider);
>  		dev_err(&pdev->dev, "failed to register PHYs: %d\n", err);
>  		goto unregister;
>  	}

And another good catch. Thanks Dan.

Acked-by: Thierry Reding <treding@nvidia.com>
Linus Walleij Aug. 11, 2014, 6:57 a.m. UTC | #2
On Thu, Jul 31, 2014 at 5:23 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:

> There is a cut and paste bug so we test the wrong variable.  "err" is
> never less than zero at this point.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied with Stephen's and Thierry's ACKs.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
index 419a047..e641b42 100644
--- a/drivers/pinctrl/pinctrl-tegra-xusb.c
+++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
@@ -930,7 +930,8 @@  static int tegra_xusb_padctl_probe(struct platform_device *pdev)
 
 	padctl->provider = devm_of_phy_provider_register(&pdev->dev,
 							 tegra_xusb_padctl_xlate);
-	if (err < 0) {
+	if (IS_ERR(padctl->provider)) {
+		err = PTR_ERR(padctl->provider);
 		dev_err(&pdev->dev, "failed to register PHYs: %d\n", err);
 		goto unregister;
 	}