diff options
Diffstat (limited to 'drivers/rtc/rtc-hi6421.c')
-rw-r--r-- | drivers/rtc/rtc-hi6421.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-hi6421.c b/drivers/rtc/rtc-hi6421.c index 14e27b96e0ef..50ec3911861b 100644 --- a/drivers/rtc/rtc-hi6421.c +++ b/drivers/rtc/rtc-hi6421.c @@ -214,29 +214,27 @@ static int hi6421_rtc_probe(struct platform_device *pdev) if (info->irq < 0) return -ENOENT; - ret = devm_request_irq(&pdev->dev, info->irq, hi6421_rtc_handler, - IRQF_DISABLED, "alarm", info); - if (ret < 0) - return ret; info->pmic = dev_get_drvdata(pdev->dev.parent); platform_set_drvdata(pdev, info); /* enable RTC device */ hi6421_pmic_write(info->pmic, REG_RTCCTRL, 1); - info->rtc = rtc_device_register(pdev->name, &pdev->dev, - &hi6421_rtc_ops, - THIS_MODULE); + info->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, + &hi6421_rtc_ops, THIS_MODULE); if (IS_ERR(info->rtc)) return PTR_ERR(info->rtc); + + ret = devm_request_irq(&pdev->dev, info->irq, hi6421_rtc_handler, + IRQF_DISABLED, "alarm", info); + if (ret < 0) + return ret; + return 0; } static int hi6421_rtc_remove(struct platform_device *pdev) { - struct hi6421_rtc_info *info = platform_get_drvdata(pdev); - - rtc_device_unregister(info->rtc); return 0; } |