diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-03-06 08:37:55 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-03-16 11:12:10 +0100 |
commit | d5d55b70984086bffe7a6321c0d28d3c7f41b9fa (patch) | |
tree | 53290021ae81beeb733d784a4644e4bcb6e02ad6 /drivers/rtc/rtc-pm8xxx.c | |
parent | f2adcb9c3abde5470c0cfbd74e40dec820a40153 (diff) | |
download | linux-d5d55b70984086bffe7a6321c0d28d3c7f41b9fa.tar.gz |
rtc: pm8xxx: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Also remove the unnecessary
error string as the core will already display error messages.
Link: https://lore.kernel.org/r/20200306073758.58050-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-pm8xxx.c')
-rw-r--r-- | drivers/rtc/rtc-pm8xxx.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c index 07ea1be3abb9..b97333c95e53 100644 --- a/drivers/rtc/rtc-pm8xxx.c +++ b/drivers/rtc/rtc-pm8xxx.c @@ -486,13 +486,11 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 1); /* Register the RTC device */ - rtc_dd->rtc = devm_rtc_device_register(&pdev->dev, "pm8xxx_rtc", - &pm8xxx_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc_dd->rtc)) { - dev_err(&pdev->dev, "%s: RTC registration failed (%ld)\n", - __func__, PTR_ERR(rtc_dd->rtc)); + rtc_dd->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(rtc_dd->rtc)) return PTR_ERR(rtc_dd->rtc); - } + + rtc_dd->rtc->ops = &pm8xxx_rtc_ops; /* Request the alarm IRQ */ rc = devm_request_any_context_irq(&pdev->dev, rtc_dd->rtc_alarm_irq, @@ -504,9 +502,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev) return rc; } - dev_dbg(&pdev->dev, "Probe success !!\n"); - - return 0; + return rtc_register_device(rtc_dd->rtc); } #ifdef CONFIG_PM_SLEEP |