Re: [PATCH -next] pinctrl: artpec6: Fix return value check in artpec6_pmx_probe()

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

 



On Tue, Apr 25, 2017 at 03:29:45AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> 
> In case of error, the function pinctrl_register() returns
> NULL not ERR_PTR(). The IS_ERR() test in the return value
> check should be replaced with NULL test.

Uh, the comment above reads as the exact opposite
of what the patch does. Your point is valid though,
but the comment needs rephrasing.

> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>

/Jesper

> ---
>  drivers/pinctrl/pinctrl-artpec6.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
> index b5a2eff..6a16019 100644
> --- a/drivers/pinctrl/pinctrl-artpec6.c
> +++ b/drivers/pinctrl/pinctrl-artpec6.c
> @@ -938,9 +938,9 @@ static int artpec6_pmx_probe(struct platform_device *pdev)
>  	pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups);
>  	pmx->pctl	    = pinctrl_register(&artpec6_desc, &pdev->dev, pmx);
>  
> -	if (!pmx->pctl) {
> +	if (IS_ERR(pmx->pctl)) {
>  		dev_err(&pdev->dev, "could not register pinctrl driver\n");
> -		return -EINVAL;
> +		return PTR_ERR(pmx->pctl);
>  	}
>  
>  	platform_set_drvdata(pdev, pmx);

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@xxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux