mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	linus.walleij@linaro.org, bgolaszewski@baylibre.com
Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] gpio: lpc32xx: Handle devm_gpiochip_add_data error codes
Date: Fri, 3 Dec 2021 09:56:37 +0200	[thread overview]
Message-ID: <0b6c05ec-638a-10d5-a3e7-e6bf69adb678@mleia.com> (raw)
In-Reply-To: <20211203074934.1559805-1-jiasheng@iscas.ac.cn>

On 12/3/21 9:49 AM, Jiasheng Jiang wrote:
> The return value of devm_gpiochip_add_data() is not always 0.
> To catch the exception in case of the failure.
> 
> Fixes: 69c0a0a52cde ("gpio: lpc32xx: Use devm_gpiochip_add_data() for gpio registration")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>   drivers/gpio/gpio-lpc32xx.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
> index 4e626c4235c2..e3b734302b76 100644
> --- a/drivers/gpio/gpio-lpc32xx.c
> +++ b/drivers/gpio/gpio-lpc32xx.c
> @@ -505,6 +505,7 @@ static int lpc32xx_of_xlate(struct gpio_chip *gc,
>   static int lpc32xx_gpio_probe(struct platform_device *pdev)
>   {
>   	int i;
> +	int err;

This was missed in v1, so formally it is not a resend, but a v2 change.

>   	void __iomem *reg_base;
>   
>   	reg_base = devm_platform_ioremap_resource(pdev, 0);
> @@ -518,8 +519,10 @@ static int lpc32xx_gpio_probe(struct platform_device *pdev)
>   			lpc32xx_gpiochip[i].chip.of_node = pdev->dev.of_node;
>   			lpc32xx_gpiochip[i].reg_base = reg_base;
>   		}
> -		devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip,
> +		err = devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip,
>   				  &lpc32xx_gpiochip[i]);
> +		if (err)
> +			return err;
>   	}
>   
>   	return 0;
> 

Thank you for the fix.

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

--
Best wishes,
Vladimir

      reply	other threads:[~2021-12-03  8:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  7:49 Jiasheng Jiang
2021-12-03  7:56 ` Vladimir Zapolskiy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b6c05ec-638a-10d5-a3e7-e6bf69adb678@mleia.com \
    --to=vz@mleia.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®