Skip to content

Commit 54116d4

Browse files
Ruan Jinjiedtor
authored andcommitted
Input: rpckbd - fix the return value handle for platform_get_irq()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 57b0c96 commit 54116d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/serio/rpckbd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ static int rpckbd_probe(struct platform_device *dev)
101101
int tx_irq, rx_irq;
102102

103103
rx_irq = platform_get_irq(dev, 0);
104-
if (rx_irq <= 0)
105-
return rx_irq < 0 ? rx_irq : -ENXIO;
104+
if (rx_irq < 0)
105+
return rx_irq;
106106

107107
tx_irq = platform_get_irq(dev, 1);
108-
if (tx_irq <= 0)
109-
return tx_irq < 0 ? tx_irq : -ENXIO;
108+
if (tx_irq < 0)
109+
return tx_irq;
110110

111111
serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
112112
rpckbd = kzalloc(sizeof(*rpckbd), GFP_KERNEL);

0 commit comments

Comments
 (0)