diff mbox series

[RFC,2/2] i2c: rcar: support named interrupts

Message ID 20240826150840.25497-6-wsa+renesas@sang-engineering.com
State New
Headers show
Series i2c: rcar: add SMBAlert support | expand

Commit Message

Wolfram Sang Aug. 26, 2024, 3:08 p.m. UTC
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-rcar.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 1104aafe4433..1a232bc88bed 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -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);