[PATCH V3 3/3] regulator: da9062: Make the use of IRQ optional

Christoph Niedermaier cniedermaier at dh-electronics.com
Tue Mar 7 02:18:13 PST 2023


This patch makes the use of IRQ optional to make the DA9061/62 usable
for designs that don't have the IRQ pin connected, because the regulator
is usable without IRQ.

Signed-off-by: Christoph Niedermaier <cniedermaier at dh-electronics.com>
Acked-by: Mark Brown <broonie at kernel.org>
Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource at dm.renesas.com>
---
Cc: Support Opensource <support.opensource at diasemi.com>
Cc: Adam Thomson <Adam.Thomson.Opensource at diasemi.com>
Cc: Liam Girdwood <lgirdwood at gmail.com>
Cc: Mark Brown <broonie at kernel.org>
Cc: Marek Vasut <marex at denx.de>
Cc: kernel at dh-electronics.com
Cc: linux-kernel at vger.kernel.org
To: linux-arm-kernel at lists.infradead.org
---
V2: - Rebase on current next 20230209
    - Add Reviewed-by and Acked-by tags
V3: - Rebase on current next 20230307
---
 drivers/regulator/da9062-regulator.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/da9062-regulator.c b/drivers/regulator/da9062-regulator.c
index 1a6324001027..653e1844dd61 100644
--- a/drivers/regulator/da9062-regulator.c
+++ b/drivers/regulator/da9062-regulator.c
@@ -1012,10 +1012,9 @@ static int da9062_regulator_probe(struct platform_device *pdev)
 	}
 
 	/* LDOs overcurrent event support */
-	irq = platform_get_irq_byname(pdev, "LDO_LIM");
-	if (irq < 0)
-		return irq;
-	regulators->irq_ldo_lim = irq;
+	regulators->irq_ldo_lim = platform_get_irq_byname_optional(pdev, "LDO_LIM");
+	if (regulators->irq_ldo_lim < 0)
+		return 0;
 
 	ret = devm_request_threaded_irq(&pdev->dev, irq,
 					NULL, da9062_ldo_lim_event,
-- 
2.11.0




More information about the linux-arm-kernel mailing list