]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: highlander: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Sun, 30 May 2021 19:13:45 +0000 (22:13 +0300)
committerWolfram Sang <wsa@kernel.org>
Tue, 3 Aug 2021 20:48:39 +0000 (22:48 +0200)
commitc4ffe9247376102aafb8634db91de72b0e5884d4
tree376397094388028f38d4a14805898d5674284b0b
parent1ec1fa6544158f4f12b34582b80d7377fa0cbfef
i2c: highlander: add IRQ check

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: e34a8d219f59 ("i2c: Renesas Highlander FPGA SMBus support")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-highlander.c