@@ -1192,10 +1192,13 @@ static int rcar_i2c_probe(struct platform_device *pdev)
goto out_pm_put;
}
- ret = platform_get_irq(pdev, 0);
- if (ret < 0)
- goto out_pm_put;
- priv->irq = ret;
+ priv->irq = platform_get_irq_byname_optional(pdev, "main");
+ if (priv->irq < 0) {
+ priv->irq = platform_get_irq(pdev, 0);
+ if (priv->irq < 0)
+ goto out_pm_put;
+ }
+
ret = devm_request_irq(dev, priv->irq, irqhandler, irqflags, dev_name(dev), priv);
if (ret < 0) {
dev_err(dev, "cannot get irq %d\n", priv->irq);
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/i2c/busses/i2c-rcar.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)