Re: [PATCH -next] gpio: aspeed: fix return value check in aspeed_gpio_probe()

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

 



On Thu, Sep 15, 2016 at 11:00 AM, Wei Yongjun <weiyj.lk@xxxxxxxxx> wrote:
> From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
>
> In case of error, the function devm_ioremap_resource() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>

Acked-by: Joel Stanley <joel@xxxxxxxxx>

Thanks for the patch!

Cheers,

Joel

> ---
>  drivers/gpio/gpio-aspeed.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
> index 9f7266e..8aa3406 100644
> --- a/drivers/gpio/gpio-aspeed.c
> +++ b/drivers/gpio/gpio-aspeed.c
> @@ -413,8 +413,8 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
>                 return -ENXIO;
>
>         gpio->base = devm_ioremap_resource(&pdev->dev, res);
> -       if (!gpio->base)
> -               return -ENOMEM;
> +       if (IS_ERR(gpio->base))
> +               return PTR_ERR(gpio->base);
>
>         spin_lock_init(&gpio->lock);
>
>
>
>
--
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