Skip to content

Commit 54116d4

Browse files
ruanjinjie-engdtor
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 <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230731122246.2028651-1-ruanjinjie@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 57b0c96 commit 54116d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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)