diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-03-05 19:04:50 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-03-16 13:12:08 +0300 |
commit | 2911ee9e60d9013dae0abc86719e884b5dfb4fda (patch) | |
tree | d4b45a7952896e86316115d38ed8c977dadaeba1 /drivers/rtc/rtc-sirfsoc.c | |
parent | b427ca8c663ea32c67702b2ff5fb19aabd57fa7f (diff) | |
download | linux-2911ee9e60d9013dae0abc86719e884b5dfb4fda.tar.xz |
rtc: sirfsoc: 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/20200305160452.27808-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-sirfsoc.c')
-rw-r--r-- | drivers/rtc/rtc-sirfsoc.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c index a2c9c55667cd..b2e72597eee8 100644 --- a/drivers/rtc/rtc-sirfsoc.c +++ b/drivers/rtc/rtc-sirfsoc.c @@ -341,28 +341,21 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev) rtcdrv->overflow_rtc = sirfsoc_rtc_readl(rtcdrv, RTC_SW_VALUE); - rtcdrv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &sirfsoc_rtc_ops, THIS_MODULE); - if (IS_ERR(rtcdrv->rtc)) { - err = PTR_ERR(rtcdrv->rtc); - dev_err(&pdev->dev, "can't register RTC device\n"); - return err; - } + rtcdrv->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(rtcdrv->rtc)) + return PTR_ERR(rtcdrv->rtc); + + rtcdrv->rtc->ops = &sirfsoc_rtc_ops; rtcdrv->irq = platform_get_irq(pdev, 0); - err = devm_request_irq( - &pdev->dev, - rtcdrv->irq, - sirfsoc_rtc_irq_handler, - IRQF_SHARED, - pdev->name, - rtcdrv); + err = devm_request_irq(&pdev->dev, rtcdrv->irq, sirfsoc_rtc_irq_handler, + IRQF_SHARED, pdev->name, rtcdrv); if (err) { dev_err(&pdev->dev, "Unable to register for the SiRF SOC RTC IRQ\n"); return err; } - return 0; + return rtc_register_device(rtcdrv->rtc); } #ifdef CONFIG_PM_SLEEP |