lkml.org 
[lkml]   [2020]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/3] gpio: bcm-kona: Fix return value of bcm_kona_gpio_probe()
pt., 22 maj 2020 o 06:12 Tiezhu Yang <yangtiezhu@loongson.cn> napisał(a):
>
> When call function devm_platform_ioremap_resource(), we should use IS_ERR()
> to check the return value and return PTR_ERR() if failed.
>
> Fixes: 72d8cb715477 ("drivers: gpio: bcm-kona: use devm_platform_ioremap_resource()")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> drivers/gpio/gpio-bcm-kona.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
> index baee8c3..cf3687a 100644
> --- a/drivers/gpio/gpio-bcm-kona.c
> +++ b/drivers/gpio/gpio-bcm-kona.c
> @@ -625,7 +625,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
>
> kona_gpio->reg_base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(kona_gpio->reg_base)) {
> - ret = -ENXIO;
> + ret = PTR_ERR(kona_gpio->reg_base);
> goto err_irq_domain;
> }
>
> --
> 2.1.0
>

I fixed the commit message, since this patch addresses the error code
propagation, not the checking itself. Applied for fixes.

Bartosz

\
 
 \ /
  Last update: 2020-05-25 11:17    [W:0.240 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site