From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Radim Pavlik <radim.pavlik@tbs-biometrics.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH] input: auo_pixcir_ts - add missing check for gpio
Date: Mon, 11 Jan 2021 21:08:05 -0800 [thread overview]
Message-ID: <X/0utdv13PT0ipTs@google.com> (raw)
In-Reply-To: <20210107093217.2499-1-radim.pavlik@tbs-biometrics.com>
Hi Radim,
On Thu, Jan 07, 2021 at 10:32:17AM +0100, Radim Pavlik wrote:
> The of_get_gpio() may return error, so check it immediately. The old
> code might fail with EPROBE_DEFER which was masked by the
> folowing gpio_is_valid() and returned EINVAL.
>
> Signed-off-by: Radim Pavlik <radim.pavlik@tbs-biometrics.com>
> ---
> drivers/input/touchscreen/auo-pixcir-ts.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
> index c33e63ca6142..8f3cfd743bdd 100644
> --- a/drivers/input/touchscreen/auo-pixcir-ts.c
> +++ b/drivers/input/touchscreen/auo-pixcir-ts.c
> @@ -479,12 +479,16 @@ static struct auo_pixcir_ts_platdata *auo_pixcir_parse_dt(struct device *dev)
> return ERR_PTR(-ENOMEM);
>
> pdata->gpio_int = of_get_gpio(np, 0);
> + if (pdata->gpio_int < 0)
> + return ERR_PTR(pdata->gpio_int);
Hmm, while this check might make sense it definitely renders the next
one unnecessary.
BTW, do you have a device that uses this touch panel? This driver could
use more improvements, such as switching to gpiod API and generic device
properties, and dropping the platform data support.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2021-01-12 5:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 9:32 [PATCH] input: auo_pixcir_ts - add missing check for gpio Radim Pavlik
2021-01-12 5:08 ` Dmitry Torokhov [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-12-21 16:12 Radim Pavlik
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=X/0utdv13PT0ipTs@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=heiko@sntech.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=radim.pavlik@tbs-biometrics.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;
as well as URLs for NNTP newsgroup(s).