Re: [PATCH -next] pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data()

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

 



Hi Wei,

2017-01-25 23:03 GMT+09:00 Wei Yongjun <weiyj.lk@xxxxxxxxx>:
> From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
>
> In case of error, the function devm_ioremap() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.
>
> Fixes: 8b1bd11c1f8f ("pinctrl: samsung: Add the support the multiple
> IORESOURCE_MEM for one pin-bank")
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> ---
>  drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
> index 3bc925f..9c03eab 100644
> --- a/drivers/pinctrl/samsung/pinctrl-samsung.c
> +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
> @@ -1009,7 +1009,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
>                 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>                 virt_base[i] = devm_ioremap(&pdev->dev, res->start,
>                                                 resource_size(res));
> -               if (IS_ERR(virt_base[i]))
> +               if (!virt_base[i])

I'd rather replace devm_ioremap() (and explicit resource struct
dereferencing, without any checks by the way), with
devm_ioremap_resource() (which actually returns ERR_PTR()s, so no need
to change the condition with it).

Best regards,
Tomasz
--
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