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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>

Attachment: pgpK0NuN5GP5f.pgp
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux