diff mbox series

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

Message ID 20221122095833.3957-4-cniedermaier@dh-electronics.com (mailing list archive)
State New, archived
Headers show
Series mfd: da9062: Make the use of IRQ optional | expand

Commit Message

Christoph Niedermaier Nov. 22, 2022, 9:58 a.m. UTC
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@dh-electronics.com>
---
Cc: Support Opensource <support.opensource@diasemi.com>
Cc: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Marek Vasut <marex@denx.de>
Cc: kernel@dh-electronics.com
Cc: linux-kernel@vger.kernel.org
To: linux-arm-kernel@lists.infradead.org
---
 drivers/regulator/da9062-regulator.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Mark Brown Nov. 22, 2022, 12:10 p.m. UTC | #1
On Tue, Nov 22, 2022 at 10:58:33AM +0100, Christoph Niedermaier wrote:
> 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.

Acked-by: Mark Brown <broonie@kernel.org>
DLG Adam Ward Nov. 23, 2022, 11:09 a.m. UTC | #2
On Tue, Nov 22, 2022 at 10:58:33AM +0100, Christoph Niedermaier wrote:
> 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.

Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.com>

Thanks,
Adam
diff mbox series

Patch

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,