[PATCH 09/59] rtc: pcf50633: stop using deprecated RTC API

Bartosz Golaszewski
2020-11-19T11:42:41Z

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