提交 f16a3bb6 编写于 作者: S Sergey Shtylyov 提交者: Wolfram Sang

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: 4ad48e6a ("i2c: Renesas Highlander FPGA SMBus support")
Signed-off-by: NSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: NWolfram Sang <wsa@kernel.org>
上级 a6b8bb6a
...@@ -379,7 +379,7 @@ static int highlander_i2c_probe(struct platform_device *pdev) ...@@ -379,7 +379,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
dev->irq = platform_get_irq(pdev, 0); dev->irq = platform_get_irq(pdev, 0);
if (iic_force_poll) if (dev->irq < 0 || iic_force_poll)
dev->irq = 0; dev->irq = 0;
if (dev->irq) { if (dev->irq) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册