All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Hans de Goede <hdegoede@redhat.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] Input: gpio_keys - Simplify with dev_err_probe()
Date: Thu, 27 Aug 2020 08:17:44 +0200	[thread overview]
Message-ID: <20200827061744.GB3355@kozik-lap> (raw)
In-Reply-To: <CAHp75VcgE+HJOKkV6-crzH1w+qOtSKR8=i1Y3ufnhTiAcYV=7A@mail.gmail.com>

On Thu, Aug 27, 2020 at 12:05:51AM +0300, Andy Shevchenko wrote:
> On Wednesday, August 26, 2020, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
> > Common pattern of handling deferred probe can be simplified with
> > dev_err_probe() and devm_fwnode_gpiod_get_optional().   Less code and
> > the error value gets printed.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> >
> > ---
> >
> > Changes since v1:
> > 1. Use devm_fwnode_gpiod_get_optional
> > ---
> >  drivers/input/keyboard/gpio_keys.c | 21 ++++-----------------
> >  1 file changed, 4 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/input/keyboard/gpio_keys.c
> > b/drivers/input/keyboard/gpio_keys.c
> > index f2d4e4daa818..a07ac6fa25ed 100644
> > --- a/drivers/input/keyboard/gpio_keys.c
> > +++ b/drivers/input/keyboard/gpio_keys.c
> > @@ -494,23 +494,10 @@ static int gpio_keys_setup_key(struct
> > platform_device *pdev,
> >         spin_lock_init(&bdata->lock);
> >
> >         if (child) {
> > -               bdata->gpiod = devm_fwnode_gpiod_get(dev, child,
> > -                                                    NULL, GPIOD_IN, desc);
> > -               if (IS_ERR(bdata->gpiod)) {
> > -                       error = PTR_ERR(bdata->gpiod);
> > -                       if (error == -ENOENT) {
> > -                               /*
> > -                                * GPIO is optional, we may be dealing with
> > -                                * purely interrupt-driven setup.
> > -                                */
> 
> 
> Can we preserve this comment?

Sure.

Best regards,
Krzysztof

  parent reply	other threads:[~2020-08-27  6:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 20:08 [PATCH v2 1/2] gpio: Add devm_fwnode_gpiod_get_optional() helpers Krzysztof Kozlowski
2020-08-26 20:08 ` [PATCH v2 2/2] Input: gpio_keys - Simplify with dev_err_probe() Krzysztof Kozlowski
2020-08-27  0:06   ` kernel test robot
     [not found]   ` <CAHp75VcgE+HJOKkV6-crzH1w+qOtSKR8=i1Y3ufnhTiAcYV=7A@mail.gmail.com>
2020-08-27  6:17     ` Krzysztof Kozlowski [this message]
2020-08-31  9:44   ` Dan Carpenter
2020-08-31  9:44     ` Dan Carpenter
2020-08-31 13:57     ` Krzysztof Kozlowski
     [not found] ` <CAHp75VfSE_9D4UBwJLt2b_JyBLiN_giOd8mWpodbMAVJ8wj=cA@mail.gmail.com>
2020-08-27  6:16   ` [PATCH v2 1/2] gpio: Add devm_fwnode_gpiod_get_optional() helpers Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
2020-08-27  3:35 [PATCH v2 2/2] Input: gpio_keys - Simplify with dev_err_probe() kernel test robot

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=20200827061744.GB3355@kozik-lap \
    --to=krzk@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gustavoars@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-input@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.