All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register()
@ 2020-11-19 11:40 Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 01/59] rtc: da9055: stop using deprecated RTC API Bartosz Golaszewski
                   ` (59 more replies)
  0 siblings, 60 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

So we now have two functions whose names are easy to confuse. I spent some
time and simply converted all RTC drivers to using the preferred interface.

Obviously these have only been compile-tested. I hope I didn't broke too
many drivers in the process. Most of the conversions was easy, sometime
it required removing unnecessary goto labels. There's also one patch
using a different devres helpers in here.

Bartosz Golaszewski (59):
  rtc: da9055: stop using deprecated RTC API
  rtc: m41t94: stop using deprecated RTC API
  rtc: ds1390: stop using deprecated RTC API
  rtc: ds3232: stop using deprecated RTC API
  rtc: rx6110: stop using deprecated RTC API
  rtc: palmas: stop using deprecated RTC API
  rtc: bq32k: stop using deprecated RTC API
  rtc: m48t35: stop using deprecated RTC API
  rtc: pcf50633: stop using deprecated RTC API
  rtc: pcf8583: stop using deprecated RTC API
  rtc: efi: stop using deprecated RTC API
  rtc: pcf8523: stop using deprecated RTC API
  rtc: stm32: stop using deprecated RTC API
  rtc: max8925: stop using deprecated RTC API
  rtc: max8907: stop using deprecated RTC API
  rtc: pxa: stop using deprecated RTC API
  rtc: hym8563: stop using deprecated RTC API
  rtc: max6916: stop using deprecated RTC API
  rtc: max8998: stop using deprecated RTC API
  rtc: s5m: use devm_i2c_new_dummy_device()
  rtc: s5m: stop using deprecated RTC API
  rtc: moxart: stop using deprecated RTC API
  rtc: hid: stop using deprecated RTC API
  rtc: generic: stop using deprecated RTC API
  rtc: lpc24xx: stop using deprecated RTC API
  rtc: spear: stop using deprecated RTC API
  rtc: max77686: stop using deprecated RTC API
  rtc: ds1286: stop using deprecated RTC API
  rtc: twl: stop using deprecated RTC API
  rtc: s3c: stop using deprecated RTC API
  rtc: mcp795: stop using deprecated RTC API
  rtc: x1205: stop using deprecated RTC API
  rtc: max6902: stop using deprecated RTC API
  rtc: max6900: stop using deprecated RTC API
  rtc: rx8025: stop using deprecated RTC API
  rtc: asm9260: stop using deprecated RTC API
  rtc: opal: stop using deprecated RTC API
  rtc: rc5t583: stop using deprecated RTC API
  rtc: wm8350: stop using deprecated RTC API
  rtc: r7301: stop using deprecated RTC API
  rtc: max8997: stop using deprecated RTC API
  rtc: isl12022: stop using deprecated RTC API
  rtc: tps80031: stop using deprecated RTC API
  rtc: rs5c372: stop using deprecated RTC API
  rtc: mt7622: stop using deprecated RTC API
  rtc: ds1302: stop using deprecated RTC API
  rtc: bq4802: stop using deprecated RTC API
  rtc: rs5c313: stop using deprecated RTC API
  rtc: em3027: stop using deprecated RTC API
  rtc: v3020: stop using deprecated RTC API
  rtc: ds1216: stop using deprecated RTC API
  rtc: rx4581: stop using deprecated RTC API
  rtc: m41t93: stop using deprecated RTC API
  rtc: fm3130: stop using deprecated RTC API
  rtc: rtd119x: stop using deprecated RTC API
  rtc: msm6242: stop using deprecated RTC API
  rtc: as3722: stop using deprecated RTC API
  rtc: lp8788: stop using deprecated RTC API
  rtc: remove devm_rtc_device_register()

 .../driver-api/driver-model/devres.rst        |  1 -
 drivers/rtc/class.c                           | 36 -------------
 drivers/rtc/rtc-as3722.c                      | 14 +++---
 drivers/rtc/rtc-asm9260.c                     | 10 ++--
 drivers/rtc/rtc-bq32k.c                       |  8 +--
 drivers/rtc/rtc-bq4802.c                      | 30 +++++------
 drivers/rtc/rtc-da9055.c                      | 19 +++----
 drivers/rtc/rtc-ds1216.c                      |  8 +--
 drivers/rtc/rtc-ds1286.c                      | 15 +++---
 drivers/rtc/rtc-ds1302.c                      | 14 +++---
 drivers/rtc/rtc-ds1390.c                      | 13 +++--
 drivers/rtc/rtc-ds3232.c                      |  7 +--
 drivers/rtc/rtc-efi.c                         |  6 +--
 drivers/rtc/rtc-em3027.c                      |  6 +--
 drivers/rtc/rtc-fm3130.c                      | 22 +++-----
 drivers/rtc/rtc-generic.c                     |  6 +--
 drivers/rtc/rtc-hid-sensor-time.c             | 21 ++++----
 drivers/rtc/rtc-hym8563.c                     |  6 +--
 drivers/rtc/rtc-isl12022.c                    | 11 ++--
 drivers/rtc/rtc-lp8788.c                      | 11 ++--
 drivers/rtc/rtc-lpc24xx.c                     | 10 ++--
 drivers/rtc/rtc-m41t93.c                      |  6 +--
 drivers/rtc/rtc-m41t94.c                      |  8 +--
 drivers/rtc/rtc-m48t35.c                      | 10 ++--
 drivers/rtc/rtc-max6900.c                     |  6 +--
 drivers/rtc/rtc-max6902.c                     |  7 +--
 drivers/rtc/rtc-max6916.c                     |  6 +--
 drivers/rtc/rtc-max77686.c                    | 13 ++---
 drivers/rtc/rtc-max8907.c                     | 14 +++---
 drivers/rtc/rtc-max8925.c                     | 14 +++---
 drivers/rtc/rtc-max8997.c                     | 21 ++++----
 drivers/rtc/rtc-max8998.c                     | 13 ++---
 drivers/rtc/rtc-mcp795.c                      |  7 +--
 drivers/rtc/rtc-moxart.c                      | 12 ++---
 drivers/rtc/rtc-msm6242.c                     |  7 +--
 drivers/rtc/rtc-mt7622.c                      | 10 ++--
 drivers/rtc/rtc-opal.c                        |  6 +--
 drivers/rtc/rtc-palmas.c                      | 15 +++---
 drivers/rtc/rtc-pcf50633.c                    |  8 +--
 drivers/rtc/rtc-pcf8523.c                     |  7 +--
 drivers/rtc/rtc-pcf8583.c                     | 10 ++--
 drivers/rtc/rtc-pxa.c                         | 13 ++---
 drivers/rtc/rtc-r7301.c                       |  7 +--
 drivers/rtc/rtc-rc5t583.c                     | 14 +++---
 drivers/rtc/rtc-rs5c313.c                     |  9 ++--
 drivers/rtc/rtc-rs5c372.c                     | 36 +++++--------
 drivers/rtc/rtc-rtd119x.c                     | 13 +++--
 drivers/rtc/rtc-rx4581.c                      |  7 +--
 drivers/rtc/rtc-rx6110.c                      | 12 ++---
 drivers/rtc/rtc-rx8025.c                      | 11 ++--
 drivers/rtc/rtc-s3c.c                         | 10 ++--
 drivers/rtc/rtc-s5m.c                         | 50 ++++++++-----------
 drivers/rtc/rtc-spear.c                       | 10 ++--
 drivers/rtc/rtc-stm32.c                       | 18 ++++---
 drivers/rtc/rtc-tps80031.c                    | 15 +++---
 drivers/rtc/rtc-twl.c                         | 12 ++---
 drivers/rtc/rtc-v3020.c                       |  9 +++-
 drivers/rtc/rtc-wm8350.c                      | 14 +++---
 drivers/rtc/rtc-x1205.c                       |  7 ++-
 include/linux/rtc.h                           |  4 --
 60 files changed, 346 insertions(+), 399 deletions(-)

-- 
2.29.1


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

* [PATCH 01/59] rtc: da9055: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 02/59] rtc: m41t94: " Bartosz Golaszewski
                   ` (58 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-da9055.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/rtc/rtc-da9055.c b/drivers/rtc/rtc-da9055.c
index 844168fcae1e..1e76042c2ed7 100644
--- a/drivers/rtc/rtc-da9055.c
+++ b/drivers/rtc/rtc-da9055.c
@@ -279,23 +279,22 @@ static int da9055_rtc_probe(struct platform_device *pdev)
 
 	ret = da9055_rtc_device_init(rtc->da9055, pdata);
 	if (ret < 0)
-		goto err_rtc;
+		return ret;
 
 	ret = da9055_reg_read(rtc->da9055, DA9055_REG_ALARM_Y);
 	if (ret < 0)
-		goto err_rtc;
+		return ret;
 
 	if (ret & DA9055_RTC_ALM_EN)
 		rtc->alarm_enable = 1;
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					&da9055_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc)) {
-		ret = PTR_ERR(rtc->rtc);
-		goto err_rtc;
-	}
+	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc->rtc))
+		return PTR_ERR(rtc->rtc);
+
+	rtc->rtc->ops = &da9055_rtc_ops;
 
 	alm_irq = platform_get_irq_byname(pdev, "ALM");
 	if (alm_irq < 0)
@@ -308,9 +307,7 @@ static int da9055_rtc_probe(struct platform_device *pdev)
 	if (ret != 0)
 		dev_err(rtc->da9055->dev, "irq registration failed: %d\n", ret);
 
-err_rtc:
-	return ret;
-
+	return devm_rtc_register_device(rtc->rtc);
 }
 
 #ifdef CONFIG_PM
-- 
2.29.1


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

* [PATCH 02/59] rtc: m41t94: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 01/59] rtc: da9055: stop using deprecated RTC API Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 03/59] rtc: ds1390: " Bartosz Golaszewski
                   ` (57 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-m41t94.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-m41t94.c b/drivers/rtc/rtc-m41t94.c
index 6803b0273302..6e970ad350d8 100644
--- a/drivers/rtc/rtc-m41t94.c
+++ b/drivers/rtc/rtc-m41t94.c
@@ -120,14 +120,14 @@ static int m41t94_probe(struct spi_device *spi)
 		return res;
 	}
 
-	rtc = devm_rtc_device_register(&spi->dev, m41t94_driver.driver.name,
-					&m41t94_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&spi->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
-	spi_set_drvdata(spi, rtc);
+	rtc->ops = &m41t94_rtc_ops;
 
-	return 0;
+	spi_set_drvdata(spi, rtc);
+	return devm_rtc_register_device(rtc);
 }
 
 static struct spi_driver m41t94_driver = {
-- 
2.29.1


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

* [PATCH 03/59] rtc: ds1390: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 01/59] rtc: da9055: stop using deprecated RTC API Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 02/59] rtc: m41t94: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 04/59] rtc: ds3232: " Bartosz Golaszewski
                   ` (56 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-ds1390.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c
index 66fc8617d07e..9e4d09eac323 100644
--- a/drivers/rtc/rtc-ds1390.c
+++ b/drivers/rtc/rtc-ds1390.c
@@ -203,14 +203,13 @@ static int ds1390_probe(struct spi_device *spi)
 	if (spi->dev.of_node)
 		ds1390_trickle_of_init(spi);
 
-	chip->rtc = devm_rtc_device_register(&spi->dev, "ds1390",
-					&ds1390_rtc_ops, THIS_MODULE);
-	if (IS_ERR(chip->rtc)) {
-		dev_err(&spi->dev, "unable to register device\n");
-		res = PTR_ERR(chip->rtc);
-	}
+	chip->rtc = devm_rtc_allocate_device(&spi->dev);
+	if (IS_ERR(chip->rtc))
+		return PTR_ERR(chip->rtc);
+
+	chip->rtc->ops = &ds1390_rtc_ops;
 
-	return res;
+	return devm_rtc_register_device(chip->rtc);
 }
 
 static const struct of_device_id ds1390_of_match[] = {
-- 
2.29.1


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

* [PATCH 04/59] rtc: ds3232: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 03/59] rtc: ds1390: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 05/59] rtc: rx6110: " Bartosz Golaszewski
                   ` (55 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-ds3232.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index 16b89035d135..962f84b1ba66 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -513,11 +513,12 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
 
 	ds3232_hwmon_register(dev, name);
 
-	ds3232->rtc = devm_rtc_device_register(dev, name, &ds3232_rtc_ops,
-						THIS_MODULE);
+	ds3232->rtc = devm_rtc_allocate_device(dev);
 	if (IS_ERR(ds3232->rtc))
 		return PTR_ERR(ds3232->rtc);
 
+	ds3232->rtc->ops = &ds3232_rtc_ops;
+
 	ret = devm_rtc_nvmem_register(ds3232->rtc, &nvmem_cfg);
 	if(ret)
 		return ret;
@@ -534,7 +535,7 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
 		}
 	}
 
-	return 0;
+	return devm_rtc_register_device(ds3232->rtc);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.29.1


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

* [PATCH 05/59] rtc: rx6110: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (3 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 04/59] rtc: ds3232: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 06/59] rtc: palmas: " Bartosz Golaszewski
                   ` (54 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rx6110.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-rx6110.c b/drivers/rtc/rtc-rx6110.c
index a7b671a21022..cdb05b67912e 100644
--- a/drivers/rtc/rtc-rx6110.c
+++ b/drivers/rtc/rtc-rx6110.c
@@ -315,20 +315,18 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
 {
 	int err;
 
-	rx6110->rtc = devm_rtc_device_register(dev,
-					       RX6110_DRIVER_NAME,
-					       &rx6110_rtc_ops, THIS_MODULE);
-
+	rx6110->rtc = devm_rtc_allocate_device(dev);
 	if (IS_ERR(rx6110->rtc))
 		return PTR_ERR(rx6110->rtc);
 
+	rx6110->rtc->ops = &rx6110_rtc_ops;
+	rx6110->rtc->max_user_freq = 1;
+
 	err = rx6110_init(rx6110);
 	if (err)
 		return err;
 
-	rx6110->rtc->max_user_freq = 1;
-
-	return 0;
+	return devm_rtc_register_device(rx6110->rtc);
 }
 
 #ifdef CONFIG_SPI_MASTER
-- 
2.29.1


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

* [PATCH 06/59] rtc: palmas: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (4 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 05/59] rtc: rx6110: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 07/59] rtc: bq32k: " Bartosz Golaszewski
                   ` (53 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-palmas.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-palmas.c b/drivers/rtc/rtc-palmas.c
index 4bcfb88674d3..d97a751b4a9a 100644
--- a/drivers/rtc/rtc-palmas.c
+++ b/drivers/rtc/rtc-palmas.c
@@ -301,13 +301,12 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 	palmas_rtc->irq = platform_get_irq(pdev, 0);
 
 	device_init_wakeup(&pdev->dev, 1);
-	palmas_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-				&palmas_rtc_ops, THIS_MODULE);
-	if (IS_ERR(palmas_rtc->rtc)) {
-		ret = PTR_ERR(palmas_rtc->rtc);
-		dev_err(&pdev->dev, "RTC register failed, err = %d\n", ret);
-		return ret;
-	}
+
+	palmas_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(palmas_rtc->rtc))
+		return PTR_ERR(palmas_rtc->rtc);
+
+	palmas_rtc->rtc->ops = &palmas_rtc_ops;
 
 	ret = devm_request_threaded_irq(&pdev->dev, palmas_rtc->irq, NULL,
 			palmas_rtc_interrupt,
@@ -318,7 +317,7 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	return 0;
+	return devm_rtc_register_device(palmas_rtc->rtc);
 }
 
 static int palmas_rtc_remove(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 07/59] rtc: bq32k: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (5 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 06/59] rtc: palmas: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 08/59] rtc: m48t35: " Bartosz Golaszewski
                   ` (52 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-bq32k.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
index 933e4237237d..75ac0697160e 100644
--- a/drivers/rtc/rtc-bq32k.c
+++ b/drivers/rtc/rtc-bq32k.c
@@ -280,11 +280,12 @@ static int bq32k_probe(struct i2c_client *client,
 	if (client->dev.of_node)
 		trickle_charger_of_init(dev, client->dev.of_node);
 
-	rtc = devm_rtc_device_register(&client->dev, bq32k_driver.driver.name,
-						&bq32k_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &bq32k_rtc_ops;
+
 	error = bq32k_sysfs_register(&client->dev);
 	if (error) {
 		dev_err(&client->dev,
@@ -292,10 +293,9 @@ static int bq32k_probe(struct i2c_client *client,
 		return error;
 	}
 
-
 	i2c_set_clientdata(client, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static int bq32k_remove(struct i2c_client *client)
-- 
2.29.1


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

* [PATCH 08/59] rtc: m48t35: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (6 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 07/59] rtc: bq32k: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:40 ` [PATCH 09/59] rtc: pcf50633: " Bartosz Golaszewski
                   ` (51 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-m48t35.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c
index 92f19bf997b2..0f4a3cb1e1f0 100644
--- a/drivers/rtc/rtc-m48t35.c
+++ b/drivers/rtc/rtc-m48t35.c
@@ -173,9 +173,13 @@ static int m48t35_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv);
 
-	priv->rtc = devm_rtc_device_register(&pdev->dev, "m48t35",
-				  &m48t35_ops, THIS_MODULE);
-	return PTR_ERR_OR_ZERO(priv->rtc);
+	priv->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(priv->rtc))
+		return PTR_ERR(priv->rtc);
+
+	priv->rtc->ops = &m48t35_ops;
+
+	return devm_rtc_register_device(priv->rtc);
 }
 
 static struct platform_driver m48t35_platform_driver = {
-- 
2.29.1


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

* [PATCH 09/59] rtc: pcf50633: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (7 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 08/59] rtc: m48t35: " Bartosz Golaszewski
@ 2020-11-19 11:40 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 10/59] rtc: pcf8583: " Bartosz Golaszewski
                   ` (50 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:40 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-pcf50633.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
index 48951a16d65d..d1ee023ce505 100644
--- a/drivers/rtc/rtc-pcf50633.c
+++ b/drivers/rtc/rtc-pcf50633.c
@@ -249,15 +249,17 @@ static int pcf50633_rtc_probe(struct platform_device *pdev)
 
 	rtc->pcf = dev_to_pcf50633(pdev->dev.parent);
 	platform_set_drvdata(pdev, rtc);
-	rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "pcf50633-rtc",
-				&pcf50633_rtc_ops, THIS_MODULE);
 
+	rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc->rtc_dev))
 		return PTR_ERR(rtc->rtc_dev);
 
+	rtc->rtc_dev->ops = &pcf50633_rtc_ops;
+
 	pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
 					pcf50633_rtc_irq, rtc);
-	return 0;
+
+	return devm_rtc_register_device(rtc->rtc_dev);
 }
 
 static int pcf50633_rtc_remove(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 10/59] rtc: pcf8583: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (8 preceding siblings ...)
  2020-11-19 11:40 ` [PATCH 09/59] rtc: pcf50633: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 11/59] rtc: efi: " Bartosz Golaszewski
                   ` (49 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-pcf8583.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
index c80ca20e5d8d..93c7bb52bb78 100644
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -290,11 +290,13 @@ static int pcf8583_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, pcf8583);
 
-	pcf8583->rtc = devm_rtc_device_register(&client->dev,
-				pcf8583_driver.driver.name,
-				&pcf8583_rtc_ops, THIS_MODULE);
+	pcf8583->rtc = devm_rtc_allocate_device(&client->dev);
+	if (IS_ERR(pcf8583->rtc))
+		return PTR_ERR(pcf8583->rtc);
 
-	return PTR_ERR_OR_ZERO(pcf8583->rtc);
+	pcf8583->rtc->ops = &pcf8583_rtc_ops;
+
+	return devm_rtc_register_device(pcf8583->rtc);
 }
 
 static const struct i2c_device_id pcf8583_id[] = {
-- 
2.29.1


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

* [PATCH 11/59] rtc: efi: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (9 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 10/59] rtc: pcf8583: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 12/59] rtc: pcf8523: " Bartosz Golaszewski
                   ` (48 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-efi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index edb64debd173..47e79a54ecae 100644
--- a/drivers/rtc/rtc-efi.c
+++ b/drivers/rtc/rtc-efi.c
@@ -261,15 +261,15 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 	if (efi.get_time(&eft, &cap) != EFI_SUCCESS)
 		return -ENODEV;
 
-	rtc = devm_rtc_device_register(&dev->dev, "rtc-efi", &efi_rtc_ops,
-					THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&dev->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &efi_rtc_ops;
 	rtc->uie_unsupported = 1;
 	platform_set_drvdata(dev, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static struct platform_driver efi_rtc_driver = {
-- 
2.29.1


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

* [PATCH 12/59] rtc: pcf8523: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (10 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 11/59] rtc: efi: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 13/59] rtc: stm32: " Bartosz Golaszewski
                   ` (47 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-pcf8523.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c
index 57d351dfe272..b525998cd70e 100644
--- a/drivers/rtc/rtc-pcf8523.c
+++ b/drivers/rtc/rtc-pcf8523.c
@@ -356,12 +356,13 @@ static int pcf8523_probe(struct i2c_client *client,
 	if (err < 0)
 		return err;
 
-	rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME,
-				       &pcf8523_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
-	return 0;
+	rtc->ops = &pcf8523_rtc_ops;
+
+	return devm_rtc_register_device(rtc);
 }
 
 static const struct i2c_device_id pcf8523_id[] = {
-- 
2.29.1


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

* [PATCH 13/59] rtc: stm32: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (11 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 12/59] rtc: pcf8523: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 14/59] rtc: max8925: " Bartosz Golaszewski
                   ` (46 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-stm32.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index d774aa18f57a..9d6be4fa885d 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -795,14 +795,11 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, rtc);
 
-	rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, pdev->name,
-						&stm32_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc_dev)) {
-		ret = PTR_ERR(rtc->rtc_dev);
-		dev_err(&pdev->dev, "rtc device registration failed, err=%d\n",
-			ret);
-		goto err;
-	}
+	rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc->rtc_dev))
+		return PTR_ERR(rtc->rtc_dev);
+
+	rtc->rtc_dev->ops = &stm32_rtc_ops;
 
 	/* Handle RTC alarm interrupts */
 	ret = devm_request_threaded_irq(&pdev->dev, rtc->irq_alarm, NULL,
@@ -829,7 +826,12 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 			 (ver >> STM32_RTC_VERR_MINREV_SHIFT) & 0xF);
 	}
 
+	ret = devm_rtc_register_device(rtc->rtc_dev);
+	if (ret)
+		goto err;
+
 	return 0;
+
 err:
 	if (rtc->data->has_pclk)
 		clk_disable_unprepare(rtc->pclk);
-- 
2.29.1


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

* [PATCH 14/59] rtc: max8925: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (12 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 13/59] rtc: stm32: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 15/59] rtc: max8907: " Bartosz Golaszewski
                   ` (45 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max8925.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c
index 64bb8ac6ef62..902403d2fb59 100644
--- a/drivers/rtc/rtc-max8925.c
+++ b/drivers/rtc/rtc-max8925.c
@@ -272,15 +272,13 @@ static int max8925_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8925-rtc",
-					&max8925_rtc_ops, THIS_MODULE);
-	ret = PTR_ERR(info->rtc_dev);
-	if (IS_ERR(info->rtc_dev)) {
-		dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
-		return ret;
-	}
+	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(info->rtc_dev))
+		return PTR_ERR(info->rtc_dev);
 
-	return 0;
+	info->rtc_dev->ops = &max8925_rtc_ops;
+
+	return devm_rtc_register_device(info->rtc_dev);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.29.1


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

* [PATCH 15/59] rtc: max8907: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (13 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 14/59] rtc: max8925: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 16/59] rtc: pxa: " Bartosz Golaszewski
                   ` (44 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max8907.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-max8907.c b/drivers/rtc/rtc-max8907.c
index db3495d10274..7987f7f99bcc 100644
--- a/drivers/rtc/rtc-max8907.c
+++ b/drivers/rtc/rtc-max8907.c
@@ -186,13 +186,11 @@ static int max8907_rtc_probe(struct platform_device *pdev)
 	rtc->max8907 = max8907;
 	rtc->regmap = max8907->regmap_rtc;
 
-	rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8907-rtc",
-					&max8907_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc_dev)) {
-		ret = PTR_ERR(rtc->rtc_dev);
-		dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
-		return ret;
-	}
+	rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc->rtc_dev))
+		return PTR_ERR(rtc->rtc_dev);
+
+	rtc->rtc_dev->ops = &max8907_rtc_ops;
 
 	rtc->irq = regmap_irq_get_virq(max8907->irqc_rtc,
 				       MAX8907_IRQ_RTC_ALARM0);
@@ -206,7 +204,7 @@ static int max8907_rtc_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "Failed to request IRQ%d: %d\n",
 			rtc->irq, ret);
 
-	return ret;
+	return devm_rtc_register_device(rtc->rtc_dev);
 }
 
 static struct platform_driver max8907_rtc_driver = {
-- 
2.29.1


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

* [PATCH 16/59] rtc: pxa: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (14 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 15/59] rtc: max8907: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 17/59] rtc: hym8563: " Bartosz Golaszewski
                   ` (43 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-pxa.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c
index d2f1d8f754bf..56d22576ae0e 100644
--- a/drivers/rtc/rtc-pxa.c
+++ b/drivers/rtc/rtc-pxa.c
@@ -351,17 +351,14 @@ static int __init pxa_rtc_probe(struct platform_device *pdev)
 
 	rtsr_clear_bits(pxa_rtc, RTSR_PIALE | RTSR_RDALE1 | RTSR_HZE);
 
-	pxa_rtc->rtc = devm_rtc_device_register(&pdev->dev, "pxa-rtc",
-						&pxa_rtc_ops, THIS_MODULE);
-	if (IS_ERR(pxa_rtc->rtc)) {
-		ret = PTR_ERR(pxa_rtc->rtc);
-		dev_err(dev, "Failed to register RTC device -> %d\n", ret);
-		return ret;
-	}
+	pxa_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(pxa_rtc->rtc))
+		return PTR_ERR(pxa_rtc->rtc);
 
+	pxa_rtc->rtc->ops = &pxa_rtc_ops;
 	device_init_wakeup(dev, 1);
 
-	return 0;
+	return devm_rtc_register_device(pxa_rtc->rtc);
 }
 
 static int __exit pxa_rtc_remove(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 17/59] rtc: hym8563: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (15 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 16/59] rtc: pxa: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 18/59] rtc: max6916: " Bartosz Golaszewski
                   ` (42 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-hym8563.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 24e0095be058..f39568c6d390 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -558,11 +558,11 @@ static int hym8563_probe(struct i2c_client *client,
 	dev_dbg(&client->dev, "rtc information is %s\n",
 		(ret & HYM8563_SEC_VL) ? "invalid" : "valid");
 
-	hym8563->rtc = devm_rtc_device_register(&client->dev, client->name,
-						&hym8563_rtc_ops, THIS_MODULE);
+	hym8563->rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(hym8563->rtc))
 		return PTR_ERR(hym8563->rtc);
 
+	hym8563->rtc->ops = &hym8563_rtc_ops;
 	/* the hym8563 alarm only supports a minute accuracy */
 	hym8563->rtc->uie_unsupported = 1;
 
@@ -570,7 +570,7 @@ static int hym8563_probe(struct i2c_client *client,
 	hym8563_clkout_register_clk(hym8563);
 #endif
 
-	return 0;
+	return devm_rtc_register_device(hym8563->rtc);
 }
 
 static const struct i2c_device_id hym8563_id[] = {
-- 
2.29.1


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

* [PATCH 18/59] rtc: max6916: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (16 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 17/59] rtc: hym8563: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 19/59] rtc: max8998: " Bartosz Golaszewski
                   ` (41 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max6916.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-max6916.c b/drivers/rtc/rtc-max6916.c
index e72e768ab8ff..06e98d6351ee 100644
--- a/drivers/rtc/rtc-max6916.c
+++ b/drivers/rtc/rtc-max6916.c
@@ -137,14 +137,14 @@ static int max6916_probe(struct spi_device *spi)
 	max6916_read_reg(&spi->dev, MAX6916_STATUS_REG, &data);
 	dev_info(&spi->dev, "MAX6916 RTC Status Reg = 0x%02x\n", data);
 
-	rtc = devm_rtc_device_register(&spi->dev, "max6916",
-				       &max6916_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&spi->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &max6916_rtc_ops;
 	spi_set_drvdata(spi, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static struct spi_driver max6916_driver = {
-- 
2.29.1


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

* [PATCH 19/59] rtc: max8998: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (17 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 18/59] rtc: max6916: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 20/59] rtc: s5m: use devm_i2c_new_dummy_device() Bartosz Golaszewski
                   ` (40 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max8998.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index c873b4509b3c..25b4f24d93b4 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -262,14 +262,11 @@ static int max8998_rtc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, info);
 
-	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8998-rtc",
-			&max8998_rtc_ops, THIS_MODULE);
+	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(info->rtc_dev))
+		return PTR_ERR(info->rtc_dev);
 
-	if (IS_ERR(info->rtc_dev)) {
-		ret = PTR_ERR(info->rtc_dev);
-		dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
-		return ret;
-	}
+	info->rtc_dev->ops = &max8998_rtc_ops;
 
 	if (!max8998->irq_domain)
 		goto no_irq;
@@ -295,7 +292,7 @@ static int max8998_rtc_probe(struct platform_device *pdev)
 				" RTC updates will be extremely slow.\n");
 	}
 
-	return 0;
+	return devm_rtc_register_device(info->rtc_dev);
 }
 
 static const struct platform_device_id max8998_rtc_id[] = {
-- 
2.29.1


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

* [PATCH 20/59] rtc: s5m: use devm_i2c_new_dummy_device()
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (18 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 19/59] rtc: max8998: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 21/59] rtc: s5m: stop using deprecated RTC API Bartosz Golaszewski
                   ` (39 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Use the managed variant of i2c_new_dummy_device() to shrink code and
remove the goto label.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-s5m.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index eb9dde4095a9..3432c6213b4c 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -760,7 +760,8 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	info->i2c = i2c_new_dummy_device(s5m87xx->i2c->adapter, RTC_I2C_ADDR);
+	info->i2c = devm_i2c_new_dummy_device(&pdev->dev, s5m87xx->i2c->adapter,
+					      RTC_I2C_ADDR);
 	if (IS_ERR(info->i2c)) {
 		dev_err(&pdev->dev, "Failed to allocate I2C for RTC\n");
 		return PTR_ERR(info->i2c);
@@ -768,10 +769,9 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 
 	info->regmap = devm_regmap_init_i2c(info->i2c, regmap_cfg);
 	if (IS_ERR(info->regmap)) {
-		ret = PTR_ERR(info->regmap);
 		dev_err(&pdev->dev, "Failed to allocate RTC register map: %d\n",
-				ret);
-		goto err;
+			ret);
+		return PTR_ERR(info->regmap);
 	}
 
 	info->dev = &pdev->dev;
@@ -781,10 +781,9 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 	if (s5m87xx->irq_data) {
 		info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);
 		if (info->irq <= 0) {
-			ret = -EINVAL;
 			dev_err(&pdev->dev, "Failed to get virtual IRQ %d\n",
 				alarm_irq);
-			goto err;
+			return -EINVAL;
 		}
 	}
 
@@ -797,10 +796,8 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc",
 						 &s5m_rtc_ops, THIS_MODULE);
 
-	if (IS_ERR(info->rtc_dev)) {
-		ret = PTR_ERR(info->rtc_dev);
-		goto err;
-	}
+	if (IS_ERR(info->rtc_dev))
+		return PTR_ERR(info->rtc_dev);
 
 	if (!info->irq) {
 		dev_info(&pdev->dev, "Alarm IRQ not available\n");
@@ -813,15 +810,10 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
 			info->irq, ret);
-		goto err;
+		return ret;
 	}
 
 	return 0;
-
-err:
-	i2c_unregister_device(info->i2c);
-
-	return ret;
 }
 
 static int s5m_rtc_remove(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 21/59] rtc: s5m: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (19 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 20/59] rtc: s5m: use devm_i2c_new_dummy_device() Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 22/59] rtc: moxart: " Bartosz Golaszewski
                   ` (38 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-s5m.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index 3432c6213b4c..0ddd3f445943 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -793,27 +793,27 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc",
-						 &s5m_rtc_ops, THIS_MODULE);
-
+	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(info->rtc_dev))
 		return PTR_ERR(info->rtc_dev);
 
-	if (!info->irq) {
-		dev_info(&pdev->dev, "Alarm IRQ not available\n");
-		return 0;
-	}
+	info->rtc_dev->ops = &s5m_rtc_ops;
 
-	ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL,
-					s5m_rtc_alarm_irq, 0, "rtc-alarm0",
-					info);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
-			info->irq, ret);
-		return ret;
+	if (info->irq) {
+		ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL,
+						s5m_rtc_alarm_irq, 0,
+						"rtc-alarm0", info);
+		if (ret < 0) {
+			dev_err(&pdev->dev,
+				"Failed to request alarm IRQ: %d: %d\n",
+				info->irq, ret);
+			return ret;
+		}
+	} else {
+		dev_info(&pdev->dev, "Alarm IRQ not available\n");
 	}
 
-	return 0;
+	return devm_rtc_register_device(info->rtc_dev);
 }
 
 static int s5m_rtc_remove(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 22/59] rtc: moxart: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (20 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 21/59] rtc: s5m: stop using deprecated RTC API Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 23/59] rtc: hid: " Bartosz Golaszewski
                   ` (37 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-moxart.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c
index 6b24ac9e1cfa..f354bc8abecf 100644
--- a/drivers/rtc/rtc-moxart.c
+++ b/drivers/rtc/rtc-moxart.c
@@ -294,15 +294,13 @@ static int moxart_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	moxart_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-						   &moxart_rtc_ops,
-						   THIS_MODULE);
-	if (IS_ERR(moxart_rtc->rtc)) {
-		dev_err(&pdev->dev, "devm_rtc_device_register failed\n");
+	moxart_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(moxart_rtc->rtc))
 		return PTR_ERR(moxart_rtc->rtc);
-	}
 
-	return 0;
+	moxart_rtc->rtc->ops = &moxart_rtc_ops;
+
+	return devm_rtc_register_device(moxart_rtc->rtc);
 }
 
 static const struct of_device_id moxart_rtc_match[] = {
-- 
2.29.1


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

* [PATCH 23/59] rtc: hid: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (21 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 22/59] rtc: moxart: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 24/59] rtc: generic: " Bartosz Golaszewski
                   ` (36 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-hid-sensor-time.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
index 1b42ee0758d2..06cd21d6d2d1 100644
--- a/drivers/rtc/rtc-hid-sensor-time.c
+++ b/drivers/rtc/rtc-hid-sensor-time.c
@@ -267,21 +267,18 @@ static int hid_time_probe(struct platform_device *pdev)
 		goto err_open;
 	}
 
-	/*
-	 * Enable HID input processing early in order to be able to read the
-	 * clock already in devm_rtc_device_register().
-	 */
-	hid_device_io_start(hsdev->hdev);
+	time_state->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(time_state->rtc)) {
+		ret = PTR_ERR(time_state->rtc);
+		goto err_rtc;
+	}
 
-	time_state->rtc = devm_rtc_device_register(&pdev->dev,
-					"hid-sensor-time", &hid_time_rtc_ops,
-					THIS_MODULE);
+	time_state->rtc->ops = &hid_time_rtc_ops;
+	hid_device_io_start(hsdev->hdev);
 
-	if (IS_ERR(time_state->rtc)) {
+	ret = devm_rtc_register_device(time_state->rtc);
+	if (ret) {
 		hid_device_io_stop(hsdev->hdev);
-		ret = PTR_ERR(time_state->rtc);
-		time_state->rtc = NULL;
-		dev_err(&pdev->dev, "rtc device register failed!\n");
 		goto err_rtc;
 	}
 
-- 
2.29.1


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

* [PATCH 24/59] rtc: generic: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (22 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 23/59] rtc: hid: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 25/59] rtc: lpc24xx: " Bartosz Golaszewski
                   ` (35 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-generic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-generic.c b/drivers/rtc/rtc-generic.c
index 89ae78e93b83..6254f65bee7d 100644
--- a/drivers/rtc/rtc-generic.c
+++ b/drivers/rtc/rtc-generic.c
@@ -15,14 +15,14 @@ static int __init generic_rtc_probe(struct platform_device *dev)
 	struct rtc_device *rtc;
 	const struct rtc_class_ops *ops = dev_get_platdata(&dev->dev);
 
-	rtc = devm_rtc_device_register(&dev->dev, "rtc-generic",
-					ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&dev->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = ops;
 	platform_set_drvdata(dev, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static struct platform_driver generic_rtc_driver = {
-- 
2.29.1


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

* [PATCH 25/59] rtc: lpc24xx: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (23 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 24/59] rtc: generic: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 26/59] rtc: spear: " Bartosz Golaszewski
                   ` (34 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-lpc24xx.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-lpc24xx.c b/drivers/rtc/rtc-lpc24xx.c
index eec881a81067..e28a00be2c0d 100644
--- a/drivers/rtc/rtc-lpc24xx.c
+++ b/drivers/rtc/rtc-lpc24xx.c
@@ -247,14 +247,18 @@ static int lpc24xx_rtc_probe(struct platform_device *pdev)
 		goto disable_clks;
 	}
 
-	rtc->rtc = devm_rtc_device_register(&pdev->dev, "lpc24xx-rtc",
-					    &lpc24xx_rtc_ops, THIS_MODULE);
+	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc->rtc)) {
-		dev_err(&pdev->dev, "can't register rtc device\n");
 		ret = PTR_ERR(rtc->rtc);
 		goto disable_clks;
 	}
 
+	rtc->rtc->ops = &lpc24xx_rtc_ops;
+
+	ret = devm_rtc_register_device(rtc->rtc);
+	if (ret)
+		goto disable_clks;
+
 	return 0;
 
 disable_clks:
-- 
2.29.1


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

* [PATCH 26/59] rtc: spear: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (24 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 25/59] rtc: lpc24xx: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 27/59] rtc: max77686: " Bartosz Golaszewski
                   ` (33 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-spear.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 833daeb7b60e..acdb37b98cc5 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -383,17 +383,19 @@ static int spear_rtc_probe(struct platform_device *pdev)
 	spin_lock_init(&config->lock);
 	platform_set_drvdata(pdev, config);
 
-	config->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					&spear_rtc_ops, THIS_MODULE);
+	config->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(config->rtc)) {
-		dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
-				PTR_ERR(config->rtc));
 		status = PTR_ERR(config->rtc);
 		goto err_disable_clock;
 	}
 
+	config->rtc->ops = &spear_rtc_ops;
 	config->rtc->uie_unsupported = 1;
 
+	status = devm_rtc_register_device(config->rtc);
+	if (status)
+		goto err_disable_clock;
+
 	if (!device_can_wakeup(&pdev->dev))
 		device_init_wakeup(&pdev->dev, 1);
 
-- 
2.29.1


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

* [PATCH 27/59] rtc: max77686: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (25 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 26/59] rtc: spear: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 28/59] rtc: ds1286: " Bartosz Golaszewski
                   ` (32 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max77686.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index d51cc12114cb..e2edae346f1c 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -758,17 +758,14 @@ static int max77686_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	info->rtc_dev = devm_rtc_device_register(&pdev->dev, id->name,
-					&max77686_rtc_ops, THIS_MODULE);
-
+	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(info->rtc_dev)) {
 		ret = PTR_ERR(info->rtc_dev);
-		dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
-		if (ret == 0)
-			ret = -EINVAL;
 		goto err_rtc;
 	}
 
+	info->rtc_dev->ops = &max77686_rtc_ops;
+
 	info->virq = regmap_irq_get_virq(info->rtc_irq_data,
 					 MAX77686_RTCIRQ_RTCA1);
 	if (info->virq <= 0) {
@@ -784,6 +781,10 @@ static int max77686_rtc_probe(struct platform_device *pdev)
 		goto err_rtc;
 	}
 
+	ret = devm_rtc_register_device(info->rtc_dev);
+	if (ret)
+		goto err_rtc;
+
 	return 0;
 
 err_rtc:
-- 
2.29.1


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

* [PATCH 28/59] rtc: ds1286: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (26 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 27/59] rtc: max77686: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 29/59] rtc: twl: " Bartosz Golaszewski
                   ` (31 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-ds1286.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-ds1286.c b/drivers/rtc/rtc-ds1286.c
index 7acf849d4902..0886ac9890c3 100644
--- a/drivers/rtc/rtc-ds1286.c
+++ b/drivers/rtc/rtc-ds1286.c
@@ -322,7 +322,6 @@ static const struct rtc_class_ops ds1286_ops = {
 
 static int ds1286_probe(struct platform_device *pdev)
 {
-	struct rtc_device *rtc;
 	struct ds1286_priv *priv;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(struct ds1286_priv), GFP_KERNEL);
@@ -335,12 +334,14 @@ static int ds1286_probe(struct platform_device *pdev)
 
 	spin_lock_init(&priv->lock);
 	platform_set_drvdata(pdev, priv);
-	rtc = devm_rtc_device_register(&pdev->dev, "ds1286", &ds1286_ops,
-					THIS_MODULE);
-	if (IS_ERR(rtc))
-		return PTR_ERR(rtc);
-	priv->rtc = rtc;
-	return 0;
+
+	priv->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(priv->rtc))
+		return PTR_ERR(priv->rtc);
+
+	priv->rtc->ops = &ds1286_ops;
+
+	return devm_rtc_register_device(priv->rtc);
 }
 
 static struct platform_driver ds1286_platform_driver = {
-- 
2.29.1


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

* [PATCH 29/59] rtc: twl: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (27 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 28/59] rtc: ds1286: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 30/59] rtc: s3c: " Bartosz Golaszewski
                   ` (30 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-twl.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index c24d1e18f56c..5caf8900b6cd 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -562,13 +562,11 @@ static int twl_rtc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, twl_rtc);
 	device_init_wakeup(&pdev->dev, 1);
 
-	twl_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					&twl_rtc_ops, THIS_MODULE);
-	if (IS_ERR(twl_rtc->rtc)) {
-		dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
-			PTR_ERR(twl_rtc->rtc));
+	twl_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(twl_rtc->rtc))
 		return PTR_ERR(twl_rtc->rtc);
-	}
+
+	twl_rtc->rtc->ops = &twl_rtc_ops;
 
 	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 					twl_rtc_interrupt,
@@ -579,7 +577,7 @@ static int twl_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	return 0;
+	return devm_rtc_register_device(twl_rtc->rtc);
 }
 
 /*
-- 
2.29.1


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

* [PATCH 30/59] rtc: s3c: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (28 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 29/59] rtc: twl: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 31/59] rtc: mcp795: " Bartosz Golaszewski
                   ` (29 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-s3c.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 24a41909f049..119ce2c08e00 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -527,14 +527,14 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 	}
 
 	/* register RTC and exit */
-	info->rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops,
-					     THIS_MODULE);
+	info->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(info->rtc)) {
-		dev_err(&pdev->dev, "cannot attach rtc\n");
 		ret = PTR_ERR(info->rtc);
 		goto err_nortc;
 	}
 
+	info->rtc->ops = &s3c_rtcops;
+
 	ret = devm_request_irq(&pdev->dev, info->irq_alarm, s3c_rtc_alarmirq,
 			       0, "s3c2410-rtc alarm", info);
 	if (ret) {
@@ -549,6 +549,10 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 		goto err_nortc;
 	}
 
+	ret = devm_rtc_register_device(info->rtc);
+	if (ret)
+		goto err_nortc;
+
 	if (info->data->select_tick_clk)
 		info->data->select_tick_clk(info);
 
-- 
2.29.1


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

* [PATCH 31/59] rtc: mcp795: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (29 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 30/59] rtc: s3c: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 32/59] rtc: x1205: " Bartosz Golaszewski
                   ` (28 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-mcp795.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-mcp795.c b/drivers/rtc/rtc-mcp795.c
index 21cbf7f892e8..04dfd1d0f9ca 100644
--- a/drivers/rtc/rtc-mcp795.c
+++ b/drivers/rtc/rtc-mcp795.c
@@ -396,11 +396,11 @@ static int mcp795_probe(struct spi_device *spi)
 	/* Clear the 12 hour mode flag*/
 	mcp795_rtcc_set_bits(&spi->dev, 0x03, MCP795_24_BIT, 0);
 
-	rtc = devm_rtc_device_register(&spi->dev, "rtc-mcp795",
-					&mcp795_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&spi->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &mcp795_rtc_ops;
 	spi_set_drvdata(spi, rtc);
 
 	if (spi->irq > 0) {
@@ -420,7 +420,8 @@ static int mcp795_probe(struct spi_device *spi)
 		else
 			device_init_wakeup(&spi->dev, true);
 	}
-	return 0;
+
+	return devm_rtc_register_device(rtc);
 }
 
 #ifdef CONFIG_OF
-- 
2.29.1


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

* [PATCH 32/59] rtc: x1205: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (30 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 31/59] rtc: mcp795: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 33/59] rtc: max6902: " Bartosz Golaszewski
                   ` (27 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-x1205.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index d1d5a44d9122..b1232ebf3ee9 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -629,12 +629,11 @@ static int x1205_probe(struct i2c_client *client,
 	if (x1205_validate_client(client) < 0)
 		return -ENODEV;
 
-	rtc = devm_rtc_device_register(&client->dev, x1205_driver.driver.name,
-					&x1205_rtc_ops, THIS_MODULE);
-
+	rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &x1205_rtc_ops;
 	i2c_set_clientdata(client, rtc);
 
 	/* Check for power failures and eventually enable the osc */
@@ -655,7 +654,7 @@ static int x1205_probe(struct i2c_client *client,
 	if (err)
 		dev_err(&client->dev, "Unable to create sysfs entries\n");
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static int x1205_remove(struct i2c_client *client)
-- 
2.29.1


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

* [PATCH 33/59] rtc: max6902: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (31 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 32/59] rtc: x1205: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 34/59] rtc: max6900: " Bartosz Golaszewski
                   ` (26 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max6902.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c
index daaeb6fb6c2d..9eed4ee05892 100644
--- a/drivers/rtc/rtc-max6902.c
+++ b/drivers/rtc/rtc-max6902.c
@@ -130,13 +130,14 @@ static int max6902_probe(struct spi_device *spi)
 	if (res != 0)
 		return res;
 
-	rtc = devm_rtc_device_register(&spi->dev, "max6902",
-				&max6902_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&spi->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &max6902_rtc_ops;
 	spi_set_drvdata(spi, rtc);
-	return 0;
+
+	return devm_rtc_register_device(rtc);
 }
 
 static struct spi_driver max6902_driver = {
-- 
2.29.1


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

* [PATCH 34/59] rtc: max6900: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (32 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 33/59] rtc: max6902: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 35/59] rtc: rx8025: " Bartosz Golaszewski
                   ` (25 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max6900.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-max6900.c b/drivers/rtc/rtc-max6900.c
index ab60f13fa3ef..a3b0ed26a8c7 100644
--- a/drivers/rtc/rtc-max6900.c
+++ b/drivers/rtc/rtc-max6900.c
@@ -207,14 +207,14 @@ max6900_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
 		return -ENODEV;
 
-	rtc = devm_rtc_device_register(&client->dev, max6900_driver.driver.name,
-					&max6900_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &max6900_rtc_ops;
 	i2c_set_clientdata(client, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static const struct i2c_device_id max6900_id[] = {
-- 
2.29.1


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

* [PATCH 35/59] rtc: rx8025: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (33 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 34/59] rtc: max6900: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 36/59] rtc: asm9260: " Bartosz Golaszewski
                   ` (24 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rx8025.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index a24f85893f90..3c08cfa779d7 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -524,12 +524,9 @@ static int rx8025_probe(struct i2c_client *client,
 	if (err)
 		return err;
 
-	rx8025->rtc = devm_rtc_device_register(&client->dev, client->name,
-					  &rx8025_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rx8025->rtc)) {
-		dev_err(&client->dev, "unable to register the class device\n");
+	rx8025->rtc = devm_rtc_allocate_device(&client->dev);
+	if (IS_ERR(rx8025->rtc))
 		return PTR_ERR(rx8025->rtc);
-	}
 
 	if (client->irq > 0) {
 		dev_info(&client->dev, "IRQ %d supplied\n", client->irq);
@@ -543,13 +540,15 @@ static int rx8025_probe(struct i2c_client *client,
 		}
 	}
 
+	rx8025->rtc->ops = &rx8025_rtc_ops;
 	rx8025->rtc->max_user_freq = 1;
 
 	/* the rx8025 alarm only supports a minute accuracy */
 	rx8025->rtc->uie_unsupported = 1;
 
 	err = rx8025_sysfs_register(&client->dev);
-	return err;
+
+	return devm_rtc_register_device(rx8025->rtc);
 }
 
 static int rx8025_remove(struct i2c_client *client)
-- 
2.29.1


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

* [PATCH 36/59] rtc: asm9260: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (34 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 35/59] rtc: rx8025: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 37/59] rtc: opal: " Bartosz Golaszewski
                   ` (23 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-asm9260.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
index 3ab81cdec00b..c74455bce8b4 100644
--- a/drivers/rtc/rtc-asm9260.c
+++ b/drivers/rtc/rtc-asm9260.c
@@ -284,14 +284,14 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
 	iowrite32(0, priv->iobase + HW_CIIR);
 	iowrite32(BM_AMR_OFF, priv->iobase + HW_AMR);
 
-	priv->rtc = devm_rtc_device_register(dev, dev_name(dev),
-					     &asm9260_rtc_ops, THIS_MODULE);
+	priv->rtc = devm_rtc_allocate_device(dev);
 	if (IS_ERR(priv->rtc)) {
 		ret = PTR_ERR(priv->rtc);
-		dev_err(dev, "Failed to register RTC device: %d\n", ret);
 		goto err_return;
 	}
 
+	priv->rtc->ops = &asm9260_rtc_ops;
+
 	ret = devm_request_threaded_irq(dev, irq_alarm, NULL,
 					asm9260_rtc_irq, IRQF_ONESHOT,
 					dev_name(dev), priv);
@@ -301,6 +301,10 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
 		goto err_return;
 	}
 
+	ret = devm_rtc_register_device(priv->rtc);
+	if (ret)
+		goto err_return;
+
 	return 0;
 
 err_return:
-- 
2.29.1


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

* [PATCH 37/59] rtc: opal: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (35 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 36/59] rtc: asm9260: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 38/59] rtc: rc5t583: " Bartosz Golaszewski
                   ` (22 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-opal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c
index 7b9f8bcf86fe..d0e13635921e 100644
--- a/drivers/rtc/rtc-opal.c
+++ b/drivers/rtc/rtc-opal.c
@@ -242,14 +242,14 @@ static int opal_rtc_probe(struct platform_device *pdev)
 		opal_rtc_ops.alarm_irq_enable = opal_tpo_alarm_irq_enable;
 	}
 
-	rtc = devm_rtc_device_register(&pdev->dev, DRVNAME, &opal_rtc_ops,
-				       THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &opal_rtc_ops;
 	rtc->uie_unsupported = 1;
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static const struct of_device_id opal_rtc_match[] = {
-- 
2.29.1


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

* [PATCH 38/59] rtc: rc5t583: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (36 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 37/59] rtc: opal: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 39/59] rtc: wm8350: " Bartosz Golaszewski
                   ` (21 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rc5t583.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-rc5t583.c b/drivers/rtc/rtc-rc5t583.c
index 18684a7026c4..20f150ab6bdb 100644
--- a/drivers/rtc/rtc-rc5t583.c
+++ b/drivers/rtc/rtc-rc5t583.c
@@ -247,15 +247,13 @@ static int rc5t583_rtc_probe(struct platform_device *pdev)
 	}
 	device_init_wakeup(&pdev->dev, 1);
 
-	ricoh_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-		&rc5t583_rtc_ops, THIS_MODULE);
-	if (IS_ERR(ricoh_rtc->rtc)) {
-		ret = PTR_ERR(ricoh_rtc->rtc);
-		dev_err(&pdev->dev, "RTC device register: err %d\n", ret);
-		return ret;
-	}
+	ricoh_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(ricoh_rtc->rtc))
+		return PTR_ERR(ricoh_rtc->rtc);
 
-	return 0;
+	ricoh_rtc->rtc->ops = &rc5t583_rtc_ops;
+
+	return devm_rtc_register_device(ricoh_rtc->rtc);
 }
 
 /*
-- 
2.29.1


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

* [PATCH 39/59] rtc: wm8350: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (37 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 38/59] rtc: rc5t583: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 40/59] rtc: r7301: " Bartosz Golaszewski
                   ` (20 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-wm8350.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index 2018614f258f..140efe601c88 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -424,13 +424,11 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	wm_rtc->rtc = devm_rtc_device_register(&pdev->dev, "wm8350",
-					&wm8350_rtc_ops, THIS_MODULE);
-	if (IS_ERR(wm_rtc->rtc)) {
-		ret = PTR_ERR(wm_rtc->rtc);
-		dev_err(&pdev->dev, "failed to register RTC: %d\n", ret);
-		return ret;
-	}
+	wm_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(wm_rtc->rtc))
+		return PTR_ERR(wm_rtc->rtc);
+
+	wm_rtc->rtc->ops = &wm8350_rtc_ops;
 
 	wm8350_register_irq(wm8350, WM8350_IRQ_RTC_SEC,
 			    wm8350_rtc_update_handler, 0,
@@ -441,7 +439,7 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
 			    wm8350_rtc_alarm_handler, 0,
 			    "RTC Alarm", wm8350);
 
-	return 0;
+	return devm_rtc_register_device(wm_rtc->rtc);
 }
 
 static int wm8350_rtc_remove(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 40/59] rtc: r7301: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (38 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 39/59] rtc: wm8350: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 41/59] rtc: max8997: " Bartosz Golaszewski
                   ` (19 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-r7301.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-r7301.c b/drivers/rtc/rtc-r7301.c
index aaf1b95e3990..a879313dbb05 100644
--- a/drivers/rtc/rtc-r7301.c
+++ b/drivers/rtc/rtc-r7301.c
@@ -381,11 +381,12 @@ static int __init rtc7301_rtc_probe(struct platform_device *dev)
 
 	platform_set_drvdata(dev, priv);
 
-	rtc = devm_rtc_device_register(&dev->dev, DRV_NAME, &rtc7301_rtc_ops,
-				       THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&dev->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &rtc7301_rtc_ops;
+
 	if (priv->irq > 0) {
 		ret = devm_request_irq(&dev->dev, priv->irq,
 				       rtc7301_irq_handler, IRQF_SHARED,
@@ -398,7 +399,7 @@ static int __init rtc7301_rtc_probe(struct platform_device *dev)
 		}
 	}
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.29.1


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

* [PATCH 41/59] rtc: max8997: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (39 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 40/59] rtc: r7301: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 42/59] rtc: isl12022: " Bartosz Golaszewski
                   ` (18 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-max8997.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index 20e50d9fdf88..d4d40851aecd 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -475,32 +475,29 @@ static int max8997_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8997-rtc",
-					&max8997_rtc_ops, THIS_MODULE);
+	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(info->rtc_dev))
+		return PTR_ERR(info->rtc_dev);
 
-	if (IS_ERR(info->rtc_dev)) {
-		ret = PTR_ERR(info->rtc_dev);
-		dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
-		return ret;
-	}
+	info->rtc_dev->ops = &max8997_rtc_ops;
 
 	virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1);
 	if (!virq) {
 		dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
-		ret = -ENXIO;
-		goto err_out;
+		return -ENXIO;
 	}
 	info->virq = virq;
 
 	ret = devm_request_threaded_irq(&pdev->dev, virq, NULL,
 				max8997_rtc_alarm_irq, 0,
 				"rtc-alarm0", info);
-	if (ret < 0)
+	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
 			info->virq, ret);
+		return ret;
+	}
 
-err_out:
-	return ret;
+	return devm_rtc_register_device(info->rtc_dev);
 }
 
 static void max8997_rtc_shutdown(struct platform_device *pdev)
-- 
2.29.1


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

* [PATCH 42/59] rtc: isl12022: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (40 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 41/59] rtc: max8997: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 43/59] rtc: tps80031: " Bartosz Golaszewski
                   ` (17 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-isl12022.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
index 961bd5d1d109..d45a1128823d 100644
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -247,10 +247,13 @@ static int isl12022_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, isl12022);
 
-	isl12022->rtc = devm_rtc_device_register(&client->dev,
-					isl12022_driver.driver.name,
-					&isl12022_rtc_ops, THIS_MODULE);
-	return PTR_ERR_OR_ZERO(isl12022->rtc);
+	isl12022->rtc = devm_rtc_allocate_device(&client->dev);
+	if (IS_ERR(isl12022->rtc))
+		return PTR_ERR(isl12022->rtc);
+
+	isl12022->rtc->ops = &isl12022_rtc_ops;
+
+	return devm_rtc_register_device(isl12022->rtc);
 }
 
 #ifdef CONFIG_OF
-- 
2.29.1


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

* [PATCH 43/59] rtc: tps80031: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (41 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 42/59] rtc: isl12022: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 44/59] rtc: rs5c372: " Bartosz Golaszewski
                   ` (16 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-tps80031.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-tps80031.c b/drivers/rtc/rtc-tps80031.c
index 737f26eb284a..65fba475bf33 100644
--- a/drivers/rtc/rtc-tps80031.c
+++ b/drivers/rtc/rtc-tps80031.c
@@ -277,13 +277,11 @@ static int tps80031_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-			       &tps80031_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc)) {
-		ret = PTR_ERR(rtc->rtc);
-		dev_err(&pdev->dev, "RTC registration failed, err %d\n", ret);
-		return ret;
-	}
+	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc->rtc))
+		return PTR_ERR(rtc->rtc);
+
+	rtc->rtc->ops = &tps80031_rtc_ops;
 
 	ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
 			tps80031_rtc_irq,
@@ -295,7 +293,8 @@ static int tps80031_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 	device_set_wakeup_capable(&pdev->dev, 1);
-	return 0;
+
+	return devm_rtc_register_device(rtc->rtc);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.29.1


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

* [PATCH 44/59] rtc: rs5c372: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (42 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 43/59] rtc: tps80031: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 45/59] rtc: mt7622: " Bartosz Golaszewski
                   ` (15 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

While at it: remove unnecessary label.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rs5c372.c | 36 +++++++++++++-----------------------
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 3bd6eaa0dcf6..d554c891706b 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -631,19 +631,15 @@ static int rs5c372_probe(struct i2c_client *client,
 				I2C_FUNC_SMBUS_BYTE_DATA |
 				I2C_FUNC_SMBUS_I2C_BLOCK))
 			smbus_mode = 1;
-		else {
+		else
 			/* Still no good, give up */
-			err = -ENODEV;
-			goto exit;
-		}
+			return -ENODEV;
 	}
 
 	rs5c372 = devm_kzalloc(&client->dev, sizeof(struct rs5c372),
 				GFP_KERNEL);
-	if (!rs5c372) {
-		err = -ENOMEM;
-		goto exit;
-	}
+	if (!rs5c372)
+		return -ENOMEM;
 
 	rs5c372->client = client;
 	i2c_set_clientdata(client, rs5c372);
@@ -659,7 +655,7 @@ static int rs5c372_probe(struct i2c_client *client,
 
 	err = rs5c_get_regs(rs5c372);
 	if (err < 0)
-		goto exit;
+		return err;
 
 	/* clock may be set for am/pm or 24 hr time */
 	switch (rs5c372->type) {
@@ -683,7 +679,7 @@ static int rs5c372_probe(struct i2c_client *client,
 		break;
 	default:
 		dev_err(&client->dev, "unknown RTC type\n");
-		goto exit;
+		return err;
 	}
 
 	/* if the oscillator lost power and no other software (like
@@ -695,7 +691,7 @@ static int rs5c372_probe(struct i2c_client *client,
 	err = rs5c_oscillator_setup(rs5c372);
 	if (unlikely(err < 0)) {
 		dev_err(&client->dev, "setup error\n");
-		goto exit;
+		return err;
 	}
 
 	dev_info(&client->dev, "%s found, %s\n",
@@ -712,23 +708,17 @@ static int rs5c372_probe(struct i2c_client *client,
 			);
 
 	/* REVISIT use client->irq to register alarm irq ... */
-	rs5c372->rtc = devm_rtc_device_register(&client->dev,
-					rs5c372_driver.driver.name,
-					&rs5c372_rtc_ops, THIS_MODULE);
+	rs5c372->rtc = devm_rtc_allocate_device(&client->dev);
+	if (IS_ERR(rs5c372->rtc))
+		return PTR_ERR(rs5c372->rtc);
 
-	if (IS_ERR(rs5c372->rtc)) {
-		err = PTR_ERR(rs5c372->rtc);
-		goto exit;
-	}
+	rs5c372->rtc->ops = &rs5c372_rtc_ops;
 
 	err = rs5c_sysfs_register(&client->dev);
 	if (err)
-		goto exit;
-
-	return 0;
+		return err;
 
-exit:
-	return err;
+	return devm_rtc_register_device(rs5c372->rtc);
 }
 
 static int rs5c372_remove(struct i2c_client *client)
-- 
2.29.1


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

* [PATCH 45/59] rtc: mt7622: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (43 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 44/59] rtc: rs5c372: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 46/59] rtc: ds1302: " Bartosz Golaszewski
                   ` (14 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-mt7622.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-mt7622.c b/drivers/rtc/rtc-mt7622.c
index f1e356394814..20db5ea43309 100644
--- a/drivers/rtc/rtc-mt7622.c
+++ b/drivers/rtc/rtc-mt7622.c
@@ -342,14 +342,18 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, true);
 
-	hw->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					   &mtk_rtc_ops, THIS_MODULE);
+	hw->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(hw->rtc)) {
 		ret = PTR_ERR(hw->rtc);
-		dev_err(&pdev->dev, "Unable to register device\n");
 		goto err;
 	}
 
+	hw->rtc->ops = &mtk_rtc_ops;
+
+	ret = devm_rtc_register_device(hw->rtc);
+	if (ret)
+		goto err;
+
 	return 0;
 err:
 	clk_disable_unprepare(hw->clk);
-- 
2.29.1


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

* [PATCH 46/59] rtc: ds1302: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (44 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 45/59] rtc: mt7622: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 47/59] rtc: bq4802: " Bartosz Golaszewski
                   ` (13 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-ds1302.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c
index b3de6d2e680a..2ab0d6ea3a1c 100644
--- a/drivers/rtc/rtc-ds1302.c
+++ b/drivers/rtc/rtc-ds1302.c
@@ -174,15 +174,13 @@ static int ds1302_probe(struct spi_device *spi)
 
 	spi_set_drvdata(spi, spi);
 
-	rtc = devm_rtc_device_register(&spi->dev, "ds1302",
-			&ds1302_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc)) {
-		status = PTR_ERR(rtc);
-		dev_err(&spi->dev, "error %d registering rtc\n", status);
-		return status;
-	}
+	rtc = devm_rtc_allocate_device(&spi->dev);
+	if (IS_ERR(rtc))
+		return PTR_ERR(rtc);
 
-	return 0;
+	rtc->ops = &ds1302_rtc_ops;
+
+	return devm_rtc_register_device(rtc);
 }
 
 static int ds1302_remove(struct spi_device *spi)
-- 
2.29.1


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

* [PATCH 47/59] rtc: bq4802: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (45 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 46/59] rtc: ds1302: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 48/59] rtc: rs5c313: " Bartosz Golaszewski
                   ` (12 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

While at it: remove unnecessary goto label.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-bq4802.c | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/drivers/rtc/rtc-bq4802.c b/drivers/rtc/rtc-bq4802.c
index 472e75668917..4661dfbddb17 100644
--- a/drivers/rtc/rtc-bq4802.c
+++ b/drivers/rtc/rtc-bq4802.c
@@ -145,16 +145,15 @@ static int bq4802_probe(struct platform_device *pdev)
 	int err = -ENOMEM;
 
 	if (!p)
-		goto out;
+		return err;
 
 	spin_lock_init(&p->lock);
 
 	p->r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!p->r) {
 		p->r = platform_get_resource(pdev, IORESOURCE_IO, 0);
-		err = -EINVAL;
 		if (!p->r)
-			goto out;
+			return -EINVAL;
 	}
 	if (p->r->flags & IORESOURCE_IO) {
 		p->ioport = p->r->start;
@@ -163,29 +162,24 @@ static int bq4802_probe(struct platform_device *pdev)
 	} else if (p->r->flags & IORESOURCE_MEM) {
 		p->regs = devm_ioremap(&pdev->dev, p->r->start,
 					resource_size(p->r));
-		if (!p->regs){
-			err = -ENOMEM;
-			goto out;
-		}
+		if (!p->regs)
+			return -ENOMEM;
+
 		p->read = bq4802_read_mem;
 		p->write = bq4802_write_mem;
 	} else {
-		err = -EINVAL;
-		goto out;
+		return -EINVAL;
 	}
 
 	platform_set_drvdata(pdev, p);
 
-	p->rtc = devm_rtc_device_register(&pdev->dev, "bq4802",
-					&bq4802_ops, THIS_MODULE);
-	if (IS_ERR(p->rtc)) {
-		err = PTR_ERR(p->rtc);
-		goto out;
-	}
+	p->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(p->rtc))
+		return PTR_ERR(p->rtc);
+
+	p->rtc->ops = &bq4802_ops;
 
-	err = 0;
-out:
-	return err;
+	return devm_rtc_register_device(p->rtc);
 
 }
 
-- 
2.29.1


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

* [PATCH 48/59] rtc: rs5c313: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (46 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 47/59] rtc: bq4802: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 49/59] rtc: em3027: " Bartosz Golaszewski
                   ` (11 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rs5c313.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-rs5c313.c b/drivers/rtc/rtc-rs5c313.c
index e98f85f34206..3813751d7c86 100644
--- a/drivers/rtc/rtc-rs5c313.c
+++ b/drivers/rtc/rtc-rs5c313.c
@@ -371,10 +371,13 @@ static int rs5c313_rtc_probe(struct platform_device *pdev)
 	rs5c313_init_port();
 	rs5c313_check_xstp_bit();
 
-	rtc = devm_rtc_device_register(&pdev->dev, "rs5c313", &rs5c313_rtc_ops,
-				       THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc))
+		return PTR_ERR(rtc);
 
-	return PTR_ERR_OR_ZERO(rtc);
+	rtc->ops = &rs5c313_rtc_ops;
+
+	return devm_rtc_register_device(rtc);
 }
 
 static struct platform_driver rs5c313_rtc_platform_driver = {
-- 
2.29.1


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

* [PATCH 49/59] rtc: em3027: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (47 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 48/59] rtc: rs5c313: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 50/59] rtc: v3020: " Bartosz Golaszewski
                   ` (10 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-em3027.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-em3027.c b/drivers/rtc/rtc-em3027.c
index 9f176bce48ba..b6c7c0c17c44 100644
--- a/drivers/rtc/rtc-em3027.c
+++ b/drivers/rtc/rtc-em3027.c
@@ -119,14 +119,14 @@ static int em3027_probe(struct i2c_client *client,
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
 		return -ENODEV;
 
-	rtc = devm_rtc_device_register(&client->dev, em3027_driver.driver.name,
-				  &em3027_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &em3027_rtc_ops;
 	i2c_set_clientdata(client, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static const struct i2c_device_id em3027_id[] = {
-- 
2.29.1


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

* [PATCH 50/59] rtc: v3020: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (48 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 49/59] rtc: em3027: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 51/59] rtc: ds1216: " Bartosz Golaszewski
                   ` (9 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-v3020.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index d2da92187d56..e947cd1538a9 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -329,13 +329,18 @@ static int rtc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, chip);
 
-	chip->rtc = devm_rtc_device_register(&pdev->dev, "v3020",
-					&v3020_rtc_ops, THIS_MODULE);
+	chip->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(chip->rtc)) {
 		retval = PTR_ERR(chip->rtc);
 		goto err_io;
 	}
 
+	chip->rtc->ops = &v3020_rtc_ops;
+
+	retval = devm_rtc_register_device(chip->rtc);
+	if (retval)
+		goto err_io;
+
 	return 0;
 
 err_io:
-- 
2.29.1


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

* [PATCH 51/59] rtc: ds1216: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (49 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 50/59] rtc: v3020: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 52/59] rtc: rx4581: " Bartosz Golaszewski
                   ` (8 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-ds1216.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-ds1216.c b/drivers/rtc/rtc-ds1216.c
index 7eeb3f359de8..594f39d4e916 100644
--- a/drivers/rtc/rtc-ds1216.c
+++ b/drivers/rtc/rtc-ds1216.c
@@ -150,14 +150,16 @@ static int __init ds1216_rtc_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->ioaddr))
 		return PTR_ERR(priv->ioaddr);
 
-	priv->rtc = devm_rtc_device_register(&pdev->dev, "ds1216",
-					&ds1216_rtc_ops, THIS_MODULE);
+	priv->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(priv->rtc))
 		return PTR_ERR(priv->rtc);
 
+	priv->rtc->ops = &ds1216_rtc_ops;
+
 	/* dummy read to get clock into a known state */
 	ds1216_read(priv->ioaddr, dummy);
-	return 0;
+
+	return devm_rtc_register_device(priv->rtc);
 }
 
 static struct platform_driver ds1216_rtc_platform_driver = {
-- 
2.29.1


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

* [PATCH 52/59] rtc: rx4581: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (50 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 51/59] rtc: ds1216: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 53/59] rtc: m41t93: " Bartosz Golaszewski
                   ` (7 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rx4581.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-rx4581.c b/drivers/rtc/rtc-rx4581.c
index c092e0452347..5d42aa051b4c 100644
--- a/drivers/rtc/rtc-rx4581.c
+++ b/drivers/rtc/rtc-rx4581.c
@@ -261,13 +261,14 @@ static int rx4581_probe(struct spi_device *spi)
 	if (res != 0)
 		return res;
 
-	rtc = devm_rtc_device_register(&spi->dev, "rx4581",
-				&rx4581_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&spi->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &rx4581_rtc_ops;
 	spi_set_drvdata(spi, rtc);
-	return 0;
+
+	return devm_rtc_register_device(rtc);
 }
 
 static const struct spi_device_id rx4581_id[] = {
-- 
2.29.1


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

* [PATCH 53/59] rtc: m41t93: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (51 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 52/59] rtc: rx4581: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 54/59] rtc: fm3130: " Bartosz Golaszewski
                   ` (6 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-m41t93.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-m41t93.c b/drivers/rtc/rtc-m41t93.c
index 9444cb5f5190..7faa8a4f0032 100644
--- a/drivers/rtc/rtc-m41t93.c
+++ b/drivers/rtc/rtc-m41t93.c
@@ -181,14 +181,14 @@ static int m41t93_probe(struct spi_device *spi)
 		return -ENODEV;
 	}
 
-	rtc = devm_rtc_device_register(&spi->dev, m41t93_driver.driver.name,
-					&m41t93_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&spi->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &m41t93_rtc_ops;
 	spi_set_drvdata(spi, rtc);
 
-	return 0;
+	return devm_rtc_register_device(rtc);
 }
 
 static struct spi_driver m41t93_driver = {
-- 
2.29.1


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

* [PATCH 54/59] rtc: fm3130: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (52 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 53/59] rtc: m41t93: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 55/59] rtc: rtd119x: " Bartosz Golaszewski
                   ` (5 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

While at it: remove unnecessary goto label.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-fm3130.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c
index 677ec2da13d8..29e296f2faab 100644
--- a/drivers/rtc/rtc-fm3130.c
+++ b/drivers/rtc/rtc-fm3130.c
@@ -344,7 +344,6 @@ static int fm3130_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
 	struct fm3130		*fm3130;
-	int			err = -ENODEV;
 	int			tmp;
 	struct i2c_adapter	*adapter = client->adapter;
 
@@ -390,8 +389,7 @@ static int fm3130_probe(struct i2c_client *client,
 	tmp = i2c_transfer(adapter, fm3130->msg, 4);
 	if (tmp != 4) {
 		dev_dbg(&client->dev, "read error %d\n", tmp);
-		err = -EIO;
-		goto exit_free;
+		return -EIO;
 	}
 
 	fm3130->regs[FM3130_RTC_CONTROL] =
@@ -501,17 +499,13 @@ static int fm3130_probe(struct i2c_client *client,
 
 	/* We won't bail out here because we just got invalid data.
 	   Time setting from u-boot doesn't work anyway */
-	fm3130->rtc = devm_rtc_device_register(&client->dev, client->name,
-				&fm3130_rtc_ops, THIS_MODULE);
-	if (IS_ERR(fm3130->rtc)) {
-		err = PTR_ERR(fm3130->rtc);
-		dev_err(&client->dev,
-			"unable to register the class device\n");
-		goto exit_free;
-	}
-	return 0;
-exit_free:
-	return err;
+	fm3130->rtc = devm_rtc_allocate_device(&client->dev);
+	if (IS_ERR(fm3130->rtc))
+		return PTR_ERR(fm3130->rtc);
+
+	fm3130->rtc->ops = &fm3130_rtc_ops;
+
+	return devm_rtc_register_device(fm3130->rtc);
 }
 
 static struct i2c_driver fm3130_driver = {
-- 
2.29.1


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

* [PATCH 55/59] rtc: rtd119x: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (53 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 54/59] rtc: fm3130: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 56/59] rtc: msm6242: " Bartosz Golaszewski
                   ` (4 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-rtd119x.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-rtd119x.c b/drivers/rtc/rtc-rtd119x.c
index bb98f2d574a5..547ab60adb3f 100644
--- a/drivers/rtc/rtc-rtd119x.c
+++ b/drivers/rtc/rtc-rtd119x.c
@@ -205,10 +205,17 @@ static int rtd119x_rtc_probe(struct platform_device *pdev)
 
 	rtd119x_rtc_set_enabled(&pdev->dev, true);
 
-	data->rtcdev = devm_rtc_device_register(&pdev->dev, "rtc",
-						&rtd119x_rtc_ops, THIS_MODULE);
+	data->rtcdev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(data->rtcdev)) {
-		dev_err(&pdev->dev, "failed to register rtc device");
+		clk_disable_unprepare(data->clk);
+		clk_put(data->clk);
+		return PTR_ERR(data->rtcdev);
+	}
+
+	data->rtcdev->ops = &rtd119x_rtc_ops;
+
+	ret = devm_rtc_register_device(data->rtcdev);
+	if (ret) {
 		clk_disable_unprepare(data->clk);
 		clk_put(data->clk);
 		return PTR_ERR(data->rtcdev);
-- 
2.29.1


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

* [PATCH 56/59] rtc: msm6242: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (54 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 55/59] rtc: rtd119x: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 57/59] rtc: as3722: " Bartosz Golaszewski
                   ` (3 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-msm6242.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-msm6242.c b/drivers/rtc/rtc-msm6242.c
index 80e364baac53..b194f8bff403 100644
--- a/drivers/rtc/rtc-msm6242.c
+++ b/drivers/rtc/rtc-msm6242.c
@@ -205,13 +205,14 @@ static int __init msm6242_rtc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	platform_set_drvdata(pdev, priv);
 
-	rtc = devm_rtc_device_register(&pdev->dev, "rtc-msm6242",
-				&msm6242_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
+	rtc->ops = &msm6242_rtc_ops;
 	priv->rtc = rtc;
-	return 0;
+
+	return devm_rtc_register_device(rtc);
 }
 
 static struct platform_driver msm6242_rtc_driver = {
-- 
2.29.1


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

* [PATCH 57/59] rtc: as3722: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (55 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 56/59] rtc: msm6242: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 58/59] rtc: lp8788: " Bartosz Golaszewski
                   ` (2 subsequent siblings)
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-as3722.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c
index 0f21af27f4cf..90e70279a5d4 100644
--- a/drivers/rtc/rtc-as3722.c
+++ b/drivers/rtc/rtc-as3722.c
@@ -189,14 +189,11 @@ static int as3722_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	as3722_rtc->rtc = devm_rtc_device_register(&pdev->dev, "as3722-rtc",
-				&as3722_rtc_ops, THIS_MODULE);
-	if (IS_ERR(as3722_rtc->rtc)) {
-		ret = PTR_ERR(as3722_rtc->rtc);
-		dev_err(&pdev->dev, "RTC register failed: %d\n", ret);
-		return ret;
-	}
+	as3722_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(as3722_rtc->rtc))
+		return PTR_ERR(as3722_rtc->rtc);
 
+	as3722_rtc->rtc->ops = &as3722_rtc_ops;
 	as3722_rtc->alarm_irq = platform_get_irq(pdev, 0);
 	dev_info(&pdev->dev, "RTC interrupt %d\n", as3722_rtc->alarm_irq);
 
@@ -209,7 +206,8 @@ static int as3722_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 	disable_irq(as3722_rtc->alarm_irq);
-	return 0;
+
+	return devm_rtc_register_device(as3722_rtc->rtc);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.29.1


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

* [PATCH 58/59] rtc: lp8788: stop using deprecated RTC API
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (56 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 57/59] rtc: as3722: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:41 ` [PATCH 59/59] rtc: remove devm_rtc_device_register() Bartosz Golaszewski
  2020-11-19 11:48 ` [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Alexandre Belloni
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-lp8788.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-lp8788.c b/drivers/rtc/rtc-lp8788.c
index c0b8fbce1082..c93bf5566e0b 100644
--- a/drivers/rtc/rtc-lp8788.c
+++ b/drivers/rtc/rtc-lp8788.c
@@ -295,17 +295,16 @@ static int lp8788_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(dev, 1);
 
-	rtc->rdev = devm_rtc_device_register(dev, "lp8788_rtc",
-					&lp8788_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rdev)) {
-		dev_err(dev, "can not register rtc device\n");
+	rtc->rdev = devm_rtc_allocate_device(dev);
+	if (IS_ERR(rtc->rdev))
 		return PTR_ERR(rtc->rdev);
-	}
+
+	rtc->rdev->ops = &lp8788_rtc_ops;
 
 	if (lp8788_alarm_irq_register(pdev, rtc))
 		dev_warn(lp->dev, "no rtc irq handler\n");
 
-	return 0;
+	return devm_rtc_register_device(rtc->rdev);
 }
 
 static struct platform_driver lp8788_rtc_driver = {
-- 
2.29.1


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

* [PATCH 59/59] rtc: remove devm_rtc_device_register()
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (57 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 58/59] rtc: lp8788: " Bartosz Golaszewski
@ 2020-11-19 11:41 ` Bartosz Golaszewski
  2020-11-19 11:48 ` [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Alexandre Belloni
  59 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 11:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

All users have been converted to using the devm_rtc_allocate_device() +
devm_rtc_register_device() pair. We can remove the deprecated interface.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 .../driver-api/driver-model/devres.rst        |  1 -
 drivers/rtc/class.c                           | 36 -------------------
 include/linux/rtc.h                           |  4 ---
 3 files changed, 41 deletions(-)

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index cd8b6e657b94..f22823af7265 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -412,7 +412,6 @@ RESET
   devm_reset_controller_register()
 
 RTC
-  devm_rtc_device_register()
   devm_rtc_allocate_device()
   devm_rtc_register_device()
   devm_rtc_nvmem_register()
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index e6b44b7c4ad3..e192ea39ff3f 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -415,42 +415,6 @@ int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
 }
 EXPORT_SYMBOL_GPL(__devm_rtc_register_device);
 
-/**
- * devm_rtc_device_register - resource managed rtc_device_register()
- * @dev: the device to register
- * @name: the name of the device (unused)
- * @ops: the rtc operations structure
- * @owner: the module owner
- *
- * @return a struct rtc on success, or an ERR_PTR on error
- *
- * Managed rtc_device_register(). The rtc_device returned from this function
- * are automatically freed on driver detach.
- * This function is deprecated, use devm_rtc_allocate_device and
- * rtc_register_device instead
- */
-struct rtc_device *devm_rtc_device_register(struct device *dev,
-					    const char *name,
-					    const struct rtc_class_ops *ops,
-					    struct module *owner)
-{
-	struct rtc_device *rtc;
-	int err;
-
-	rtc = devm_rtc_allocate_device(dev);
-	if (IS_ERR(rtc))
-		return rtc;
-
-	rtc->ops = ops;
-
-	err = __devm_rtc_register_device(owner, rtc);
-	if (err)
-		return ERR_PTR(err);
-
-	return rtc;
-}
-EXPORT_SYMBOL_GPL(devm_rtc_device_register);
-
 static int __init rtc_init(void)
 {
 	rtc_class = class_create(THIS_MODULE, "rtc");
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 55e7beed066c..e3623446a9d7 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -150,10 +150,6 @@ struct rtc_device {
 #define RTC_TIMESTAMP_END_2199		7258118399LL /* 2199-12-31 23:59:59 */
 #define RTC_TIMESTAMP_END_9999		253402300799LL /* 9999-12-31 23:59:59 */
 
-extern struct rtc_device *devm_rtc_device_register(struct device *dev,
-					const char *name,
-					const struct rtc_class_ops *ops,
-					struct module *owner);
 struct rtc_device *devm_rtc_allocate_device(struct device *dev);
 int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc);
 
-- 
2.29.1


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

* Re: [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register()
  2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
                   ` (58 preceding siblings ...)
  2020-11-19 11:41 ` [PATCH 59/59] rtc: remove devm_rtc_device_register() Bartosz Golaszewski
@ 2020-11-19 11:48 ` Alexandre Belloni
  2020-11-19 12:15   ` Bartosz Golaszewski
  59 siblings, 1 reply; 62+ messages in thread
From: Alexandre Belloni @ 2020-11-19 11:48 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Alessandro Zummo, linux-rtc, linux-kernel, Bartosz Golaszewski

On 19/11/2020 12:40:50+0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> So we now have two functions whose names are easy to confuse. I spent some
> time and simply converted all RTC drivers to using the preferred interface.
> 
> Obviously these have only been compile-tested. I hope I didn't broke too
> many drivers in the process. Most of the conversions was easy, sometime
> it required removing unnecessary goto labels. There's also one patch
> using a different devres helpers in here.
> 

I'm not going to apply this series as this is not how I wanted to
proceed (else this would have been done a while ago).

> Bartosz Golaszewski (59):
>   rtc: da9055: stop using deprecated RTC API
>   rtc: m41t94: stop using deprecated RTC API
>   rtc: ds1390: stop using deprecated RTC API
>   rtc: ds3232: stop using deprecated RTC API
>   rtc: rx6110: stop using deprecated RTC API
>   rtc: palmas: stop using deprecated RTC API
>   rtc: bq32k: stop using deprecated RTC API
>   rtc: m48t35: stop using deprecated RTC API
>   rtc: pcf50633: stop using deprecated RTC API
>   rtc: pcf8583: stop using deprecated RTC API
>   rtc: efi: stop using deprecated RTC API
>   rtc: pcf8523: stop using deprecated RTC API
>   rtc: stm32: stop using deprecated RTC API
>   rtc: max8925: stop using deprecated RTC API
>   rtc: max8907: stop using deprecated RTC API
>   rtc: pxa: stop using deprecated RTC API
>   rtc: hym8563: stop using deprecated RTC API
>   rtc: max6916: stop using deprecated RTC API
>   rtc: max8998: stop using deprecated RTC API
>   rtc: s5m: use devm_i2c_new_dummy_device()
>   rtc: s5m: stop using deprecated RTC API
>   rtc: moxart: stop using deprecated RTC API
>   rtc: hid: stop using deprecated RTC API
>   rtc: generic: stop using deprecated RTC API
>   rtc: lpc24xx: stop using deprecated RTC API
>   rtc: spear: stop using deprecated RTC API
>   rtc: max77686: stop using deprecated RTC API
>   rtc: ds1286: stop using deprecated RTC API
>   rtc: twl: stop using deprecated RTC API
>   rtc: s3c: stop using deprecated RTC API
>   rtc: mcp795: stop using deprecated RTC API
>   rtc: x1205: stop using deprecated RTC API
>   rtc: max6902: stop using deprecated RTC API
>   rtc: max6900: stop using deprecated RTC API
>   rtc: rx8025: stop using deprecated RTC API
>   rtc: asm9260: stop using deprecated RTC API
>   rtc: opal: stop using deprecated RTC API
>   rtc: rc5t583: stop using deprecated RTC API
>   rtc: wm8350: stop using deprecated RTC API
>   rtc: r7301: stop using deprecated RTC API
>   rtc: max8997: stop using deprecated RTC API
>   rtc: isl12022: stop using deprecated RTC API
>   rtc: tps80031: stop using deprecated RTC API
>   rtc: rs5c372: stop using deprecated RTC API
>   rtc: mt7622: stop using deprecated RTC API
>   rtc: ds1302: stop using deprecated RTC API
>   rtc: bq4802: stop using deprecated RTC API
>   rtc: rs5c313: stop using deprecated RTC API
>   rtc: em3027: stop using deprecated RTC API
>   rtc: v3020: stop using deprecated RTC API
>   rtc: ds1216: stop using deprecated RTC API
>   rtc: rx4581: stop using deprecated RTC API
>   rtc: m41t93: stop using deprecated RTC API
>   rtc: fm3130: stop using deprecated RTC API
>   rtc: rtd119x: stop using deprecated RTC API
>   rtc: msm6242: stop using deprecated RTC API
>   rtc: as3722: stop using deprecated RTC API
>   rtc: lp8788: stop using deprecated RTC API
>   rtc: remove devm_rtc_device_register()
> 
>  .../driver-api/driver-model/devres.rst        |  1 -
>  drivers/rtc/class.c                           | 36 -------------
>  drivers/rtc/rtc-as3722.c                      | 14 +++---
>  drivers/rtc/rtc-asm9260.c                     | 10 ++--
>  drivers/rtc/rtc-bq32k.c                       |  8 +--
>  drivers/rtc/rtc-bq4802.c                      | 30 +++++------
>  drivers/rtc/rtc-da9055.c                      | 19 +++----
>  drivers/rtc/rtc-ds1216.c                      |  8 +--
>  drivers/rtc/rtc-ds1286.c                      | 15 +++---
>  drivers/rtc/rtc-ds1302.c                      | 14 +++---
>  drivers/rtc/rtc-ds1390.c                      | 13 +++--
>  drivers/rtc/rtc-ds3232.c                      |  7 +--
>  drivers/rtc/rtc-efi.c                         |  6 +--
>  drivers/rtc/rtc-em3027.c                      |  6 +--
>  drivers/rtc/rtc-fm3130.c                      | 22 +++-----
>  drivers/rtc/rtc-generic.c                     |  6 +--
>  drivers/rtc/rtc-hid-sensor-time.c             | 21 ++++----
>  drivers/rtc/rtc-hym8563.c                     |  6 +--
>  drivers/rtc/rtc-isl12022.c                    | 11 ++--
>  drivers/rtc/rtc-lp8788.c                      | 11 ++--
>  drivers/rtc/rtc-lpc24xx.c                     | 10 ++--
>  drivers/rtc/rtc-m41t93.c                      |  6 +--
>  drivers/rtc/rtc-m41t94.c                      |  8 +--
>  drivers/rtc/rtc-m48t35.c                      | 10 ++--
>  drivers/rtc/rtc-max6900.c                     |  6 +--
>  drivers/rtc/rtc-max6902.c                     |  7 +--
>  drivers/rtc/rtc-max6916.c                     |  6 +--
>  drivers/rtc/rtc-max77686.c                    | 13 ++---
>  drivers/rtc/rtc-max8907.c                     | 14 +++---
>  drivers/rtc/rtc-max8925.c                     | 14 +++---
>  drivers/rtc/rtc-max8997.c                     | 21 ++++----
>  drivers/rtc/rtc-max8998.c                     | 13 ++---
>  drivers/rtc/rtc-mcp795.c                      |  7 +--
>  drivers/rtc/rtc-moxart.c                      | 12 ++---
>  drivers/rtc/rtc-msm6242.c                     |  7 +--
>  drivers/rtc/rtc-mt7622.c                      | 10 ++--
>  drivers/rtc/rtc-opal.c                        |  6 +--
>  drivers/rtc/rtc-palmas.c                      | 15 +++---
>  drivers/rtc/rtc-pcf50633.c                    |  8 +--
>  drivers/rtc/rtc-pcf8523.c                     |  7 +--
>  drivers/rtc/rtc-pcf8583.c                     | 10 ++--
>  drivers/rtc/rtc-pxa.c                         | 13 ++---
>  drivers/rtc/rtc-r7301.c                       |  7 +--
>  drivers/rtc/rtc-rc5t583.c                     | 14 +++---
>  drivers/rtc/rtc-rs5c313.c                     |  9 ++--
>  drivers/rtc/rtc-rs5c372.c                     | 36 +++++--------
>  drivers/rtc/rtc-rtd119x.c                     | 13 +++--
>  drivers/rtc/rtc-rx4581.c                      |  7 +--
>  drivers/rtc/rtc-rx6110.c                      | 12 ++---
>  drivers/rtc/rtc-rx8025.c                      | 11 ++--
>  drivers/rtc/rtc-s3c.c                         | 10 ++--
>  drivers/rtc/rtc-s5m.c                         | 50 ++++++++-----------
>  drivers/rtc/rtc-spear.c                       | 10 ++--
>  drivers/rtc/rtc-stm32.c                       | 18 ++++---
>  drivers/rtc/rtc-tps80031.c                    | 15 +++---
>  drivers/rtc/rtc-twl.c                         | 12 ++---
>  drivers/rtc/rtc-v3020.c                       |  9 +++-
>  drivers/rtc/rtc-wm8350.c                      | 14 +++---
>  drivers/rtc/rtc-x1205.c                       |  7 ++-
>  include/linux/rtc.h                           |  4 --
>  60 files changed, 346 insertions(+), 399 deletions(-)
> 
> -- 
> 2.29.1
> 

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

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

* Re: [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register()
  2020-11-19 11:48 ` [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Alexandre Belloni
@ 2020-11-19 12:15   ` Bartosz Golaszewski
  0 siblings, 0 replies; 62+ messages in thread
From: Bartosz Golaszewski @ 2020-11-19 12:15 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: Bartosz Golaszewski, Alessandro Zummo, linux-rtc, LKML

On Thu, Nov 19, 2020 at 12:48 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 19/11/2020 12:40:50+0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > So we now have two functions whose names are easy to confuse. I spent some
> > time and simply converted all RTC drivers to using the preferred interface.
> >
> > Obviously these have only been compile-tested. I hope I didn't broke too
> > many drivers in the process. Most of the conversions was easy, sometime
> > it required removing unnecessary goto labels. There's also one patch
> > using a different devres helpers in here.
> >
>
> I'm not going to apply this series as this is not how I wanted to
> proceed (else this would have been done a while ago).
>

What's the plan then?

Bartosz

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

end of thread, other threads:[~2020-11-19 12:16 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 11:40 [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 01/59] rtc: da9055: stop using deprecated RTC API Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 02/59] rtc: m41t94: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 03/59] rtc: ds1390: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 04/59] rtc: ds3232: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 05/59] rtc: rx6110: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 06/59] rtc: palmas: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 07/59] rtc: bq32k: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 08/59] rtc: m48t35: " Bartosz Golaszewski
2020-11-19 11:40 ` [PATCH 09/59] rtc: pcf50633: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 10/59] rtc: pcf8583: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 11/59] rtc: efi: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 12/59] rtc: pcf8523: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 13/59] rtc: stm32: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 14/59] rtc: max8925: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 15/59] rtc: max8907: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 16/59] rtc: pxa: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 17/59] rtc: hym8563: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 18/59] rtc: max6916: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 19/59] rtc: max8998: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 20/59] rtc: s5m: use devm_i2c_new_dummy_device() Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 21/59] rtc: s5m: stop using deprecated RTC API Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 22/59] rtc: moxart: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 23/59] rtc: hid: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 24/59] rtc: generic: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 25/59] rtc: lpc24xx: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 26/59] rtc: spear: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 27/59] rtc: max77686: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 28/59] rtc: ds1286: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 29/59] rtc: twl: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 30/59] rtc: s3c: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 31/59] rtc: mcp795: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 32/59] rtc: x1205: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 33/59] rtc: max6902: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 34/59] rtc: max6900: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 35/59] rtc: rx8025: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 36/59] rtc: asm9260: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 37/59] rtc: opal: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 38/59] rtc: rc5t583: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 39/59] rtc: wm8350: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 40/59] rtc: r7301: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 41/59] rtc: max8997: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 42/59] rtc: isl12022: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 43/59] rtc: tps80031: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 44/59] rtc: rs5c372: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 45/59] rtc: mt7622: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 46/59] rtc: ds1302: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 47/59] rtc: bq4802: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 48/59] rtc: rs5c313: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 49/59] rtc: em3027: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 50/59] rtc: v3020: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 51/59] rtc: ds1216: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 52/59] rtc: rx4581: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 53/59] rtc: m41t93: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 54/59] rtc: fm3130: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 55/59] rtc: rtd119x: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 56/59] rtc: msm6242: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 57/59] rtc: as3722: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 58/59] rtc: lp8788: " Bartosz Golaszewski
2020-11-19 11:41 ` [PATCH 59/59] rtc: remove devm_rtc_device_register() Bartosz Golaszewski
2020-11-19 11:48 ` [PATCH 00/59] rtc: remove all uses of devm_rtc_device_register() Alexandre Belloni
2020-11-19 12:15   ` Bartosz Golaszewski

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.