* [PATCH -next] input: serio: fix the return value handle for platform_get_irq()
@ 2023-07-31 12:22 Ruan Jinjie
2023-08-01 23:54 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Ruan Jinjie @ 2023-07-31 12:22 UTC (permalink / raw)
To: dmitry.torokhov, wsa+renesas, christophe.jaillet, linux-input; +Cc: ruanjinjie
There is no possible for platform_get_irq() to return 0,
and the return value of platform_get_irq() is more sensible
to show the error reason.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
drivers/input/serio/rpckbd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index ce420eb1f51b..e8a9709f32eb 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -101,12 +101,12 @@ static int rpckbd_probe(struct platform_device *dev)
int tx_irq, rx_irq;
rx_irq = platform_get_irq(dev, 0);
- if (rx_irq <= 0)
- return rx_irq < 0 ? rx_irq : -ENXIO;
+ if (rx_irq < 0)
+ return rx_irq;
tx_irq = platform_get_irq(dev, 1);
- if (tx_irq <= 0)
- return tx_irq < 0 ? tx_irq : -ENXIO;
+ if (tx_irq < 0)
+ return tx_irq;
serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
rpckbd = kzalloc(sizeof(*rpckbd), GFP_KERNEL);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] input: serio: fix the return value handle for platform_get_irq()
2023-07-31 12:22 [PATCH -next] input: serio: fix the return value handle for platform_get_irq() Ruan Jinjie
@ 2023-08-01 23:54 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2023-08-01 23:54 UTC (permalink / raw)
To: Ruan Jinjie; +Cc: wsa+renesas, christophe.jaillet, linux-input
On Mon, Jul 31, 2023 at 08:22:46PM +0800, Ruan Jinjie wrote:
> There is no possible for platform_get_irq() to return 0,
> and the return value of platform_get_irq() is more sensible
> to show the error reason.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-01 23:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31 12:22 [PATCH -next] input: serio: fix the return value handle for platform_get_irq() Ruan Jinjie
2023-08-01 23:54 ` Dmitry Torokhov
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).