From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-input@vger.kernel.org,
Darren Hart <dvhart@infradead.org>,
platform-driver-x86@vger.kernel.org,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 4/4] Input: soc_button_array - Propagate error from gpiod_count()
Date: Thu, 23 Feb 2017 00:40:32 -0800 [thread overview]
Message-ID: <20170223084032.GG18639@dtor-ws> (raw)
In-Reply-To: <20170220161549.39490-5-andriy.shevchenko@linux.intel.com>
On Mon, Feb 20, 2017 at 06:15:49PM +0200, Andy Shevchenko wrote:
> Since gpiod_count() does not return 0 anymore, we don't need to shadow
> its error code and would safely propagate to the user.
>
> While here, replace second parameter by NULL in order to prevent side
> effects on _DSD enabled firmware.
>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/misc/soc_button_array.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
> index ddb2f22fca7a..c3b8e1fb4699 100644
> --- a/drivers/input/misc/soc_button_array.c
> +++ b/drivers/input/misc/soc_button_array.c
> @@ -169,9 +169,10 @@ static int soc_button_probe(struct platform_device *pdev)
>
> button_info = (struct soc_button_info *)id->driver_data;
>
> - if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
> + error = gpiod_count(dev, NULL);
> + if (error < 0) {
> dev_dbg(dev, "no GPIO attached, ignoring...\n");
> - return -ENODEV;
> + return error;
> }
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> --
> 2.11.0
>
--
Dmitry
next prev parent reply other threads:[~2017-02-23 8:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 16:15 [PATCH v1 0/4] gpio: make gpiod_count() API consistent Andy Shevchenko
2017-02-20 16:15 ` [PATCH v1 1/4] gpio: acpi: Don't return 0 on acpi_gpio_count() Andy Shevchenko
2017-03-14 9:43 ` Linus Walleij
2017-03-14 11:51 ` Mika Westerberg
2017-03-16 14:42 ` Linus Walleij
2017-02-20 16:15 ` [PATCH v1 2/4] gpio: of: Don't return 0 on dt_gpio_count() Andy Shevchenko
2017-03-16 14:43 ` Linus Walleij
2017-02-20 16:15 ` [PATCH v1 3/4] platform/x86: surface3_button: Propagate error from gpiod_count() Andy Shevchenko
2017-03-14 9:46 ` Linus Walleij
2017-03-14 12:28 ` Andy Shevchenko
2017-03-16 14:45 ` Linus Walleij
2017-02-20 16:15 ` [PATCH v1 4/4] Input: soc_button_array - " Andy Shevchenko
2017-02-23 8:40 ` Dmitry Torokhov [this message]
2017-03-16 14:46 ` Linus Walleij
2017-02-27 8:27 ` [PATCH v1 0/4] gpio: make gpiod_count() API consistent Benjamin Tissoires
2017-02-28 9:48 ` Andy Shevchenko
2017-03-14 9:49 ` Linus Walleij
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=20170223084032.GG18639@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dvhart@infradead.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@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;
as well as URLs for NNTP newsgroup(s).