All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: <linux-arm-kernel@lists.infradead.org>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>,
	"Support Opensource" <support.opensource@diasemi.com>,
	Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Marek Vasut <marex@denx.de>,
	<kernel@dh-electronics.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH V3 3/3] regulator: da9062: Make the use of IRQ optional
Date: Tue, 7 Mar 2023 11:18:13 +0100	[thread overview]
Message-ID: <20230307101813.77267-3-cniedermaier@dh-electronics.com> (raw)
In-Reply-To: <20230307101813.77267-1-cniedermaier@dh-electronics.com>

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>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.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
---
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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: <linux-arm-kernel@lists.infradead.org>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>,
	"Support Opensource" <support.opensource@diasemi.com>,
	Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Marek Vasut <marex@denx.de>,
	<kernel@dh-electronics.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH V3 3/3] regulator: da9062: Make the use of IRQ optional
Date: Tue, 7 Mar 2023 11:18:13 +0100	[thread overview]
Message-ID: <20230307101813.77267-3-cniedermaier@dh-electronics.com> (raw)
In-Reply-To: <20230307101813.77267-1-cniedermaier@dh-electronics.com>

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>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.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
---
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


  parent reply	other threads:[~2023-03-07 10:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 10:18 [PATCH V3 1/3] mfd: da9062: Use MFD_CELL_OF macro Christoph Niedermaier
2023-03-07 10:18 ` Christoph Niedermaier
2023-03-07 10:18 ` [PATCH V3 2/3] mfd: da9062: Remove IRQ requirement Christoph Niedermaier
2023-03-07 10:18   ` Christoph Niedermaier
2023-03-08  9:23   ` DLG Adam Ward
2023-03-08  9:23     ` DLG Adam Ward
2023-03-07 10:18 ` Christoph Niedermaier [this message]
2023-03-07 10:18   ` [PATCH V3 3/3] regulator: da9062: Make the use of IRQ optional Christoph Niedermaier
2023-03-08 15:11   ` kernel test robot
2023-03-08 15:11     ` kernel test robot
2023-03-08  9:23 ` [PATCH V3 1/3] mfd: da9062: Use MFD_CELL_OF macro DLG Adam Ward
2023-03-08  9:23   ` DLG Adam Ward

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230307101813.77267-3-cniedermaier@dh-electronics.com \
    --to=cniedermaier@dh-electronics.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=broonie@kernel.org \
    --cc=kernel@dh-electronics.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.