i2c: highlander: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Sun, 30 May 2021 19:13:45 +0000 (22:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 09:43:00 +0000 (11:43 +0200)
commit398f2c0bce102735c24644575222e3f0347e16b9
tree5cc050ab712b1d002fd6685cf6512749a1c35cfb
parent57744fad6203491e510cfd7661921239cffba118
i2c: highlander: add IRQ check

[ Upstream commit f16a3bb69aa6baabf8f0aca982c8cf21e2a4f6bc ]

The driver is written as if platform_get_irq() returns 0 on errors (while
actually it returns a negative error code), blithely passing these error
codes to request_irq() (which takes *unsigned* IRQ #) -- which fails with
-EINVAL. Add the necessary error check to the pre-existing *if* statement
forcing the driver into the polling mode...

Fixes: 4ad48e6ab18c ("i2c: Renesas Highlander FPGA SMBus support")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-highlander.c