Skip to content

Commit 7ec1701

Browse files
Sergey ShtylyovKelsey Skunberg
authored andcommitted
i2c: highlander: add IRQ check
BugLink: https://bugs.launchpad.net/bugs/1946024 [ Upstream commit f16a3bb ] 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: 4ad48e6 ("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> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
1 parent fd3d393 commit 7ec1701

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-highlander.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
379379
platform_set_drvdata(pdev, dev);
380380

381381
dev->irq = platform_get_irq(pdev, 0);
382-
if (iic_force_poll)
382+
if (dev->irq < 0 || iic_force_poll)
383383
dev->irq = 0;
384384

385385
if (dev->irq) {

0 commit comments

Comments
 (0)