[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200827061744.GB3355@kozik-lap>
Date: Thu, 27 Aug 2020 08:17:44 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Hans de Goede <hdegoede@...hat.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] Input: gpio_keys - Simplify with dev_err_probe()
On Thu, Aug 27, 2020 at 12:05:51AM +0300, Andy Shevchenko wrote:
> On Wednesday, August 26, 2020, Krzysztof Kozlowski <krzk@...nel.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@...nel.org>
> > Reviewed-by: Hans de Goede <hdegoede@...hat.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
Powered by blists - more mailing lists