public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code
@ 2025-02-05  0:58 Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 1/7] rtc: stm32: Use resource managed API " Peng Fan (OSS)
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan, Antonio Borneo

This is a pick-up of patch 6-12 from patchset [1]

Since devm_pm_set_wake_irq is in 6.14, so resend the rtc parts.

R-b tags from Linus Walleij and Antonio Borneo are still kept.

[1] https://lore.kernel.org/all/CAJZ5v0jb=0c5m=FeA-W-aG30H4706Ay_xCHTsiC1S-7MuGxqTQ@mail.gmail.com/#r

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (7):
      rtc: stm32: Use resource managed API to simplify code
      rtc: nxp-bbnsm: Use resource managed API to simplify code
      rtc: ds1343: Use devm_pm_set_wake_irq
      rtc: pm8xxx: Use devm_pm_set_wake_irq
      rtc: ab8500: Use resource managed API to simplify code
      rtc: mpfs: Use devm_pm_set_wake_irq
      rtc: pl031: Use resource managed API to simplify code

 drivers/rtc/rtc-ab8500.c    | 11 ++---------
 drivers/rtc/rtc-ds1343.c    |  8 +-------
 drivers/rtc/rtc-mpfs.c      |  8 +-------
 drivers/rtc/rtc-nxp-bbnsm.c | 29 +++++++++--------------------
 drivers/rtc/rtc-pl031.c     |  6 ++----
 drivers/rtc/rtc-pm8xxx.c    | 12 +-----------
 drivers/rtc/rtc-stm32.c     | 10 ++--------
 7 files changed, 18 insertions(+), 66 deletions(-)
---
base-commit: 40b8e93e17bff4a4e0cc129e04f9fdf5daa5397e
change-id: 20250205-rtc-cleanup-d3d42ceb3d28

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/7] rtc: stm32: Use resource managed API to simplify code
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 2/7] rtc: nxp-bbnsm: " Peng Fan (OSS)
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan, Antonio Borneo

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the
error handling code and 'driver.remove()' hook.

Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-stm32.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index a0564d4435690313b86669893ec639af90fd6b68..1b715db47160158b3cfc79c437ea956e301deeb5 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -1143,11 +1143,11 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	ret = device_init_wakeup(&pdev->dev, true);
+	ret = devm_device_init_wakeup(&pdev->dev);
 	if (ret)
 		goto err;
 
-	ret = dev_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm);
+	ret = devm_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm);
 	if (ret)
 		goto err;
 
@@ -1208,9 +1208,6 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 	if (rtc->data->need_dbp)
 		regmap_update_bits(rtc->dbp, rtc->dbp_reg, rtc->dbp_mask, 0);
 
-	dev_pm_clear_wake_irq(&pdev->dev);
-	device_init_wakeup(&pdev->dev, false);
-
 	return ret;
 }
 
@@ -1237,9 +1234,6 @@ static void stm32_rtc_remove(struct platform_device *pdev)
 	/* Enable backup domain write protection if needed */
 	if (rtc->data->need_dbp)
 		regmap_update_bits(rtc->dbp, rtc->dbp_reg, rtc->dbp_mask, 0);
-
-	dev_pm_clear_wake_irq(&pdev->dev);
-	device_init_wakeup(&pdev->dev, false);
 }
 
 static int stm32_rtc_suspend(struct device *dev)

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/7] rtc: nxp-bbnsm: Use resource managed API to simplify code
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 1/7] rtc: stm32: Use resource managed API " Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 3/7] rtc: ds1343: Use devm_pm_set_wake_irq Peng Fan (OSS)
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the
error handling code and 'driver.remove()' hook.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-nxp-bbnsm.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/rtc/rtc-nxp-bbnsm.c b/drivers/rtc/rtc-nxp-bbnsm.c
index fa3b0328c7a255ff8a902a58d61a4b0e59eac493..d4fc9dc583d317d4852b7d897a6c45cfff6961a2 100644
--- a/drivers/rtc/rtc-nxp-bbnsm.c
+++ b/drivers/rtc/rtc-nxp-bbnsm.c
@@ -189,36 +189,26 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)
 	/* clear all the pending events */
 	regmap_write(bbnsm->regmap, BBNSM_EVENTS, 0x7A);
 
-	device_init_wakeup(&pdev->dev, true);
-	dev_pm_set_wake_irq(&pdev->dev, bbnsm->irq);
+	ret = devm_device_init_wakeup(&pdev->dev);
+	if (ret)
+		dev_err(&pdev->dev, "failed to init wakeup, %d\n", ret);
+
+	ret = devm_pm_set_wake_irq(&pdev->dev, bbnsm->irq);
+	if (ret)
+		dev_err(&pdev->dev, "failed to set wake irq, %d\n", ret);
 
 	ret = devm_request_irq(&pdev->dev, bbnsm->irq, bbnsm_rtc_irq_handler,
 			       IRQF_SHARED, "rtc alarm", &pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request irq %d: %d\n",
 			bbnsm->irq, ret);
-		goto err;
+		return ret;
 	}
 
 	bbnsm->rtc->ops = &bbnsm_rtc_ops;
 	bbnsm->rtc->range_max = U32_MAX;
 
-	ret = devm_rtc_register_device(bbnsm->rtc);
-	if (ret)
-		goto err;
-
-	return 0;
-
-err:
-	dev_pm_clear_wake_irq(&pdev->dev);
-	device_init_wakeup(&pdev->dev, false);
-	return ret;
-}
-
-static void bbnsm_rtc_remove(struct platform_device *pdev)
-{
-	dev_pm_clear_wake_irq(&pdev->dev);
-	device_init_wakeup(&pdev->dev, false);
+	return devm_rtc_register_device(bbnsm->rtc);
 }
 
 static const struct of_device_id bbnsm_dt_ids[] = {
@@ -233,7 +223,6 @@ static struct platform_driver bbnsm_rtc_driver = {
 		.of_match_table = bbnsm_dt_ids,
 	},
 	.probe = bbnsm_rtc_probe,
-	.remove = bbnsm_rtc_remove,
 };
 module_platform_driver(bbnsm_rtc_driver);
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/7] rtc: ds1343: Use devm_pm_set_wake_irq
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 1/7] rtc: stm32: Use resource managed API " Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 2/7] rtc: nxp-bbnsm: " Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 4/7] rtc: pm8xxx: " Peng Fan (OSS)
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-ds1343.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c
index ed5a6ba89a3eeb2a0b9d6dea3c8b3d40aa2cf317..aa9500791b7e0300b150bd654b69c74f3e5e6e6b 100644
--- a/drivers/rtc/rtc-ds1343.c
+++ b/drivers/rtc/rtc-ds1343.c
@@ -427,18 +427,13 @@ static int ds1343_probe(struct spi_device *spi)
 				"unable to request irq for rtc ds1343\n");
 		} else {
 			device_init_wakeup(&spi->dev, true);
-			dev_pm_set_wake_irq(&spi->dev, spi->irq);
+			devm_pm_set_wake_irq(&spi->dev, spi->irq);
 		}
 	}
 
 	return 0;
 }
 
-static void ds1343_remove(struct spi_device *spi)
-{
-	dev_pm_clear_wake_irq(&spi->dev);
-}
-
 #ifdef CONFIG_PM_SLEEP
 
 static int ds1343_suspend(struct device *dev)
@@ -471,7 +466,6 @@ static struct spi_driver ds1343_driver = {
 		.pm = &ds1343_pm,
 	},
 	.probe = ds1343_probe,
-	.remove = ds1343_remove,
 	.id_table = ds1343_id,
 };
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/7] rtc: pm8xxx: Use devm_pm_set_wake_irq
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
                   ` (2 preceding siblings ...)
  2025-02-05  0:58 ` [PATCH 3/7] rtc: ds1343: Use devm_pm_set_wake_irq Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 5/7] rtc: ab8500: Use resource managed API to simplify code Peng Fan (OSS)
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-pm8xxx.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index b2518aea4218f36ba24a5fb660ed11c1dd78940b..852d80188bd0b5e75882c7945f166162fb039507 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -523,21 +523,11 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
 	if (rc)
 		return rc;
 
-	rc = dev_pm_set_wake_irq(&pdev->dev, rtc_dd->alarm_irq);
-	if (rc)
-		return rc;
-
-	return 0;
-}
-
-static void pm8xxx_remove(struct platform_device *pdev)
-{
-	dev_pm_clear_wake_irq(&pdev->dev);
+	return devm_pm_set_wake_irq(&pdev->dev, rtc_dd->alarm_irq);
 }
 
 static struct platform_driver pm8xxx_rtc_driver = {
 	.probe		= pm8xxx_rtc_probe,
-	.remove		= pm8xxx_remove,
 	.driver	= {
 		.name		= "rtc-pm8xxx",
 		.of_match_table	= pm8xxx_id_table,

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/7] rtc: ab8500: Use resource managed API to simplify code
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
                   ` (3 preceding siblings ...)
  2025-02-05  0:58 ` [PATCH 4/7] rtc: pm8xxx: " Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 6/7] rtc: mpfs: Use devm_pm_set_wake_irq Peng Fan (OSS)
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the
error handling code and 'driver.remove()' hook.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-ab8500.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index 2dcda96f4a8ef727514c751322b84d8d2b382b75..ed2b6b8bb3bf8f99fef9f8bee9676f71f8a86d2a 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -361,7 +361,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	device_init_wakeup(&pdev->dev, true);
+	devm_device_init_wakeup(&pdev->dev);
 
 	rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc))
@@ -375,7 +375,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
 	if (err < 0)
 		return err;
 
-	dev_pm_set_wake_irq(&pdev->dev, irq);
+	devm_pm_set_wake_irq(&pdev->dev, irq);
 	platform_set_drvdata(pdev, rtc);
 
 	set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->features);
@@ -392,18 +392,11 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
 	return devm_rtc_register_device(rtc);
 }
 
-static void ab8500_rtc_remove(struct platform_device *pdev)
-{
-	dev_pm_clear_wake_irq(&pdev->dev);
-	device_init_wakeup(&pdev->dev, false);
-}
-
 static struct platform_driver ab8500_rtc_driver = {
 	.driver = {
 		.name = "ab8500-rtc",
 	},
 	.probe	= ab8500_rtc_probe,
-	.remove = ab8500_rtc_remove,
 	.id_table = ab85xx_rtc_ids,
 };
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/7] rtc: mpfs: Use devm_pm_set_wake_irq
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
                   ` (4 preceding siblings ...)
  2025-02-05  0:58 ` [PATCH 5/7] rtc: ab8500: Use resource managed API to simplify code Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-02-05  0:58 ` [PATCH 7/7] rtc: pl031: Use resource managed API to simplify code Peng Fan (OSS)
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-mpfs.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-mpfs.c b/drivers/rtc/rtc-mpfs.c
index 3892b0f9917fa7bc4f732cfe2c2b2f548ba7429f..5a38649cbd43b3c6f2fec5db95c4f0013deb2a08 100644
--- a/drivers/rtc/rtc-mpfs.c
+++ b/drivers/rtc/rtc-mpfs.c
@@ -267,18 +267,13 @@ static int mpfs_rtc_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "prescaler set to: %lu\n", prescaler);
 
 	device_init_wakeup(&pdev->dev, true);
-	ret = dev_pm_set_wake_irq(&pdev->dev, wakeup_irq);
+	ret = devm_pm_set_wake_irq(&pdev->dev, wakeup_irq);
 	if (ret)
 		dev_err(&pdev->dev, "failed to enable irq wake\n");
 
 	return devm_rtc_register_device(rtcdev->rtc);
 }
 
-static void mpfs_rtc_remove(struct platform_device *pdev)
-{
-	dev_pm_clear_wake_irq(&pdev->dev);
-}
-
 static const struct of_device_id mpfs_rtc_of_match[] = {
 	{ .compatible = "microchip,mpfs-rtc" },
 	{ }
@@ -288,7 +283,6 @@ MODULE_DEVICE_TABLE(of, mpfs_rtc_of_match);
 
 static struct platform_driver mpfs_rtc_driver = {
 	.probe = mpfs_rtc_probe,
-	.remove = mpfs_rtc_remove,
 	.driver	= {
 		.name = "mpfs_rtc",
 		.of_match_table = mpfs_rtc_of_match,

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] rtc: pl031: Use resource managed API to simplify code
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
                   ` (5 preceding siblings ...)
  2025-02-05  0:58 ` [PATCH 6/7] rtc: mpfs: Use devm_pm_set_wake_irq Peng Fan (OSS)
@ 2025-02-05  0:58 ` Peng Fan (OSS)
  2025-03-03  8:03 ` [PATCH 0/7] rtc: Use devm_pm_set_wake_irq " Peng Fan
  2025-03-03 21:53 ` Alexandre Belloni
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2025-02-05  0:58 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the
error handling code and 'driver.remove()' hook.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/rtc/rtc-pl031.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index bad6a5d9c6839ca70905e3d46286b9729c1fd435..47bfc5395e5908b7722b98276399120f1ba65af0 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -284,8 +284,6 @@ static void pl031_remove(struct amba_device *adev)
 {
 	struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
 
-	dev_pm_clear_wake_irq(&adev->dev);
-	device_init_wakeup(&adev->dev, false);
 	if (adev->irq[0])
 		free_irq(adev->irq[0], ldata);
 	amba_release_regions(adev);
@@ -350,7 +348,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
 		}
 	}
 
-	device_init_wakeup(&adev->dev, true);
+	devm_device_init_wakeup(&adev->dev);
 	ldata->rtc = devm_rtc_allocate_device(&adev->dev);
 	if (IS_ERR(ldata->rtc)) {
 		ret = PTR_ERR(ldata->rtc);
@@ -373,7 +371,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
 				  vendor->irqflags, "rtc-pl031", ldata);
 		if (ret)
 			goto out;
-		dev_pm_set_wake_irq(&adev->dev, adev->irq[0]);
+		devm_pm_set_wake_irq(&adev->dev, adev->irq[0]);
 	}
 	return 0;
 

-- 
2.37.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
                   ` (6 preceding siblings ...)
  2025-02-05  0:58 ` [PATCH 7/7] rtc: pl031: Use resource managed API to simplify code Peng Fan (OSS)
@ 2025-03-03  8:03 ` Peng Fan
  2025-03-03 21:53 ` Alexandre Belloni
  8 siblings, 0 replies; 10+ messages in thread
From: Peng Fan @ 2025-03-03  8:03 UTC (permalink / raw)
  To: Alexandre Belloni, Maxime Coquelin, Alexandre Torgue,
	Linus Walleij, Conor Dooley, Daire McNamara
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan, Antonio Borneo

Hi Alexandre,

On Wed, Feb 05, 2025 at 08:58:18AM +0800, Peng Fan (OSS) wrote:
>This is a pick-up of patch 6-12 from patchset [1]
>
Do you have time to give a look on this patchset?

Thanks,
Peng

>Since devm_pm_set_wake_irq is in 6.14, so resend the rtc parts.
>
>R-b tags from Linus Walleij and Antonio Borneo are still kept.
>
>[1] https://lore.kernel.org/all/CAJZ5v0jb=0c5m=FeA-W-aG30H4706Ay_xCHTsiC1S-7MuGxqTQ@mail.gmail.com/#r


>
>Signed-off-by: Peng Fan <peng.fan@nxp.com>
>---
>Peng Fan (7):
>      rtc: stm32: Use resource managed API to simplify code
>      rtc: nxp-bbnsm: Use resource managed API to simplify code
>      rtc: ds1343: Use devm_pm_set_wake_irq
>      rtc: pm8xxx: Use devm_pm_set_wake_irq
>      rtc: ab8500: Use resource managed API to simplify code
>      rtc: mpfs: Use devm_pm_set_wake_irq
>      rtc: pl031: Use resource managed API to simplify code
>
> drivers/rtc/rtc-ab8500.c    | 11 ++---------
> drivers/rtc/rtc-ds1343.c    |  8 +-------
> drivers/rtc/rtc-mpfs.c      |  8 +-------
> drivers/rtc/rtc-nxp-bbnsm.c | 29 +++++++++--------------------
> drivers/rtc/rtc-pl031.c     |  6 ++----
> drivers/rtc/rtc-pm8xxx.c    | 12 +-----------
> drivers/rtc/rtc-stm32.c     | 10 ++--------
> 7 files changed, 18 insertions(+), 66 deletions(-)
>---
>base-commit: 40b8e93e17bff4a4e0cc129e04f9fdf5daa5397e
>change-id: 20250205-rtc-cleanup-d3d42ceb3d28
>
>Best regards,
>-- 
>Peng Fan <peng.fan@nxp.com>
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code
  2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
                   ` (7 preceding siblings ...)
  2025-03-03  8:03 ` [PATCH 0/7] rtc: Use devm_pm_set_wake_irq " Peng Fan
@ 2025-03-03 21:53 ` Alexandre Belloni
  8 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2025-03-03 21:53 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Linus Walleij, Conor Dooley,
	Daire McNamara, Peng Fan (OSS)
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, linux-kernel,
	linux-arm-msm, linux-riscv, Peng Fan, Antonio Borneo

On Wed, 05 Feb 2025 08:58:18 +0800, Peng Fan (OSS) wrote:
> This is a pick-up of patch 6-12 from patchset [1]
> 
> Since devm_pm_set_wake_irq is in 6.14, so resend the rtc parts.
> 
> R-b tags from Linus Walleij and Antonio Borneo are still kept.
> 
> [1] https://lore.kernel.org/all/CAJZ5v0jb=0c5m=FeA-W-aG30H4706Ay_xCHTsiC1S-7MuGxqTQ@mail.gmail.com/#r
> 
> [...]

Applied, thanks!

[1/7] rtc: stm32: Use resource managed API to simplify code
      https://git.kernel.org/abelloni/c/04572d18921d
[2/7] rtc: nxp-bbnsm: Use resource managed API to simplify code
      https://git.kernel.org/abelloni/c/6b296dee3eb7
[3/7] rtc: ds1343: Use devm_pm_set_wake_irq
      https://git.kernel.org/abelloni/c/5ad218f101e4
[4/7] rtc: pm8xxx: Use devm_pm_set_wake_irq
      https://git.kernel.org/abelloni/c/e8a0b6e62429
[5/7] rtc: ab8500: Use resource managed API to simplify code
      https://git.kernel.org/abelloni/c/ca36c9301117
[6/7] rtc: mpfs: Use devm_pm_set_wake_irq
      https://git.kernel.org/abelloni/c/d8690ce183bb
[7/7] rtc: pl031: Use resource managed API to simplify code
      https://git.kernel.org/abelloni/c/90e0bcc9392d

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-03 21:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05  0:58 [PATCH 0/7] rtc: Use devm_pm_set_wake_irq to simplify code Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 1/7] rtc: stm32: Use resource managed API " Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 2/7] rtc: nxp-bbnsm: " Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 3/7] rtc: ds1343: Use devm_pm_set_wake_irq Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 4/7] rtc: pm8xxx: " Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 5/7] rtc: ab8500: Use resource managed API to simplify code Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 6/7] rtc: mpfs: Use devm_pm_set_wake_irq Peng Fan (OSS)
2025-02-05  0:58 ` [PATCH 7/7] rtc: pl031: Use resource managed API to simplify code Peng Fan (OSS)
2025-03-03  8:03 ` [PATCH 0/7] rtc: Use devm_pm_set_wake_irq " Peng Fan
2025-03-03 21:53 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox