Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peter Tyser <ptyser@xes-inc.com>,
	Andy Shevchenko <andy@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>, <linux-gpio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path
Date: Tue, 16 May 2023 10:19:51 -0500	[thread overview]
Message-ID: <b2ca9df3-6c02-d68d-3a85-acfc4d22217b@ti.com> (raw)
In-Reply-To: <CAHp75Veu-HbANATV2trD=wAkNx4zia2L8Y+roLQ9k9VA_Vxu3Q@mail.gmail.com>

On 5/15/23 4:08 PM, Andy Shevchenko wrote:
> On Mon, May 15, 2023 at 8:42 PM Andrew Davis <afd@ti.com> wrote:
>>
>> Use devm version of gpiochip add function to handle removal for us.
> 
> ...version of gpiochip_add() function...
> 
> ...
> 
>> +               err = devm_gpiochip_add_data(&pdev->dev, &block->chip, block);
>>                  if (err < 0) {
>>                          dev_err(&pdev->dev,
>>                                  "Could not register gpiochip, %d\n", err);
>> -                       goto exit_err;
>> +                       return err;
> 
> With this applied you can consider a followup to have this be converted to use
> 
>      return dev_err_probe(...);
> 
> here and in other ->probe() related pieces.
> 

Sure, I can add that cleanup to my list.

Or maybe Coccinelle can help do this everywhere, will have to look into that.

Andrew

>>                  }
> 

  reply	other threads:[~2023-05-16 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 17:42 [PATCH v3] gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path Andrew Davis
2023-05-15 21:08 ` Andy Shevchenko
2023-05-16 15:19   ` Andrew Davis [this message]
2023-05-17  9:52 ` Bartosz Golaszewski

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=b2ca9df3-6c02-d68d-3a85-acfc4d22217b@ti.com \
    --to=afd@ti.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptyser@xes-inc.com \
    /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