aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-tps65910.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2018-08-20 18:05:17 +0200
committerJiri Kosina <jkosina@suse.cz>2018-08-20 18:05:17 +0200
commit415d2b3392d7a80903e0f97f051201aa02bf20e9 (patch)
tree47492d2386a0e7f00ef645313cb44ae4960b7e7e /drivers/rtc/rtc-tps65910.c
parentHID: hiddev: fix potential Spectre v1 (diff)
parentHID: cougar: Add support for the Cougar 500k Gaming Keyboard (diff)
downloadlinux-dev-415d2b3392d7a80903e0f97f051201aa02bf20e9.tar.xz
linux-dev-415d2b3392d7a80903e0f97f051201aa02bf20e9.zip
Merge branch 'for-4.19/cougar' into for-linus
New device support for hid-cougar
Diffstat (limited to 'drivers/rtc/rtc-tps65910.c')
-rw-r--r--drivers/rtc/rtc-tps65910.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index d0244d7979fc..a9bbd022aeef 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -380,6 +380,10 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
if (!tps_rtc)
return -ENOMEM;
+ tps_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(tps_rtc->rtc))
+ return PTR_ERR(tps_rtc->rtc);
+
/* Clear pending interrupts */
ret = regmap_read(tps65910->regmap, TPS65910_RTC_STATUS, &rtc_reg);
if (ret < 0)
@@ -421,10 +425,12 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
tps_rtc->irq = irq;
device_set_wakeup_capable(&pdev->dev, 1);
- tps_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &tps65910_rtc_ops, THIS_MODULE);
- if (IS_ERR(tps_rtc->rtc)) {
- ret = PTR_ERR(tps_rtc->rtc);
+ tps_rtc->rtc->ops = &tps65910_rtc_ops;
+ tps_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
+ tps_rtc->rtc->range_max = RTC_TIMESTAMP_END_2099;
+
+ ret = rtc_register_device(tps_rtc->rtc);
+ if (ret) {
dev_err(&pdev->dev, "RTC device register: err %d\n", ret);
return ret;
}
@@ -432,17 +438,6 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
return 0;
}
-/*
- * Disable tps65910 RTC interrupts.
- * Sets status flag to free.
- */
-static int tps65910_rtc_remove(struct platform_device *pdev)
-{
- tps65910_rtc_alarm_irq_enable(&pdev->dev, 0);
-
- return 0;
-}
-
#ifdef CONFIG_PM_SLEEP
static int tps65910_rtc_suspend(struct device *dev)
{
@@ -468,7 +463,6 @@ static SIMPLE_DEV_PM_OPS(tps65910_rtc_pm_ops, tps65910_rtc_suspend,
static struct platform_driver tps65910_rtc_driver = {
.probe = tps65910_rtc_probe,
- .remove = tps65910_rtc_remove,
.driver = {
.name = "tps65910-rtc",
.pm = &tps65910_rtc_pm_ops,