From: Tang Bin <tangbin@cmss.chinamobile.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Markus Elfring <Markus.Elfring@web.de>
Cc: linux-input@vger.kernel.org, Allison Randal <allison@lohutok.net>,
Arnd Bergmann <arnd@arndb.de>,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Olof Johansson <olof@lixom.net>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: Input: ep93xx_keypad: Checking for a failed platform_get_irq()call in ep93xx_keypad_probe()
Date: Fri, 10 Apr 2020 10:52:50 +0800 [thread overview]
Message-ID: <55fdfd83-dc4f-36e9-b8a7-96ad4881a2ce@cmss.chinamobile.com> (raw)
In-Reply-To: <20200409204819.GR75430@dtor-ws>
Hi Dmitry:
On 2020/4/10 4:48, Dmitry Torokhov wrote:
> Platform code historically allowed creating IRQ resources with IRQ
> number 0 to indicate "no interrupt assigned", so this driver tries to
> filter out such conditions. The negative IRQs (errors) will be rejected
> by request_irq() but I guess we can lose -EPROBE_DEFER. We could do
>
> if (keypad->irq <= 0) {
> err = keypad->irq ?: -ENXIO : keypad->irq;
> goto failed_free;
> }
>
>
I have been aware of this problem for a few days, and by doing
experiments on the hardware, I have found the following ways that maybe
suitable:
if (keypad->irq <= 0) {
err = keypad->irq ? : -ENXIO;
goto failed_free;
}
or
if (keypad->irq <= 0) {
err = keypad->irq < 0 ? keypad->irq : -ENXIO;
goto failed_free;
}
If you think it's usefull, I will send this patch to fix it.
Thanks
Tang Bin
>
next prev parent reply other threads:[~2020-04-10 2:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-08 16:52 Input: ep93xx_keypad: Checking for a failed platform_get_irq() call in ep93xx_keypad_probe() Markus Elfring
2020-04-09 20:48 ` Dmitry Torokhov
2020-04-10 2:52 ` Tang Bin [this message]
2020-04-10 2:56 ` Input: ep93xx_keypad: Checking for a failed platform_get_irq()call " Tang Bin
2020-04-10 5:45 ` Input: ep93xx_keypad: Checking for a failed platform_get_irq() call " Markus Elfring
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=55fdfd83-dc4f-36e9-b8a7-96ad4881a2ce@cmss.chinamobile.com \
--to=tangbin@cmss.chinamobile.com \
--cc=Markus.Elfring@web.de \
--cc=allison@lohutok.net \
--cc=arnd@arndb.de \
--cc=dmitry.torokhov@gmail.com \
--cc=hsweeten@visionengravers.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=tglx@linutronix.de \
/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).