aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/rtc/rtc-mt2712.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-06-07 16:11:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-07 16:11:23 -0700
commite8dff03aef6a76c5c9184ed1dd3c770d4ce9c885 (patch)
treefe96dbed37472dfc2fe812b7ca825e27d2ca8a6a /drivers/rtc/rtc-mt2712.c
parentMerge tag 'ntb-5.8' of git://github.com/jonmason/ntb (diff)
parentrtc: pcf2127: watchdog: handle nowayout feature (diff)
downloadwireguard-linux-e8dff03aef6a76c5c9184ed1dd3c770d4ce9c885.tar.xz
wireguard-linux-e8dff03aef6a76c5c9184ed1dd3c770d4ce9c885.zip
Merge tag 'rtc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Not much this cycle apart from the ingenic rtc driver rework. The fixes are mainly minor issues reported by coccinelle rather than real world issues. Subsystem: - new VL flag for backup switch over Drivers: - ingenic: only support device tree - pcf2127: report battery switch over, handle nowayout" * tag 'rtc-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (29 commits) rtc: pcf2127: watchdog: handle nowayout feature rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake rtc: abx80x: Provide debug feedback for invalid dt properties rtc: abx80x: Add Device Tree matching table rtc: rv3028: Add missed check for devm_regmap_init_i2c() rtc: mpc5121: Use correct return value for mpc5121_rtc_probe() rtc: goldfish: Use correct return value for goldfish_rtc_probe() rtc: snvs: Add necessary clock operations for RTC APIs rtc: snvs: Make SNVS clock always prepared rtc: ingenic: Reset regulator register in probe rtc: ingenic: Fix masking of error code rtc: ingenic: Remove unused fields from private structure rtc: ingenic: Set wakeup params in probe rtc: ingenic: Enable clock in probe rtc: ingenic: Use local 'dev' variable in probe rtc: ingenic: Only support probing from devicetree rtc: mc13xxx: fix a double-unlock issue rtc: stmp3xxx: update contact email rtc: max77686: Use single-byte writes on MAX77620 rtc: pcf2127: report battery switch over ...
Diffstat (limited to 'drivers/rtc/rtc-mt2712.c')
-rw-r--r--drivers/rtc/rtc-mt2712.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-mt2712.c b/drivers/rtc/rtc-mt2712.c
index 581b8731fb8a..d5f691c8a035 100644
--- a/drivers/rtc/rtc-mt2712.c
+++ b/drivers/rtc/rtc-mt2712.c
@@ -310,7 +310,6 @@ static const struct rtc_class_ops mt2712_rtc_ops = {
static int mt2712_rtc_probe(struct platform_device *pdev)
{
- struct resource *res;
struct mt2712_rtc *mt2712_rtc;
int ret;
@@ -319,8 +318,7 @@ static int mt2712_rtc_probe(struct platform_device *pdev)
if (!mt2712_rtc)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- mt2712_rtc->base = devm_ioremap_resource(&pdev->dev, res);
+ mt2712_rtc->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mt2712_rtc->base))
return PTR_ERR(mt2712_rtc->base);
@@ -328,10 +326,8 @@ static int mt2712_rtc_probe(struct platform_device *pdev)
mt2712_rtc_hw_init(mt2712_rtc);
mt2712_rtc->irq = platform_get_irq(pdev, 0);
- if (mt2712_rtc->irq < 0) {
- dev_err(&pdev->dev, "No IRQ resource\n");
+ if (mt2712_rtc->irq < 0)
return mt2712_rtc->irq;
- }
platform_set_drvdata(pdev, mt2712_rtc);
@@ -356,13 +352,7 @@ static int mt2712_rtc_probe(struct platform_device *pdev)
mt2712_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
mt2712_rtc->rtc->range_max = MT2712_RTC_TIMESTAMP_END_2127;
- ret = rtc_register_device(mt2712_rtc->rtc);
- if (ret) {
- dev_err(&pdev->dev, "register rtc device failed\n");
- return ret;
- }
-
- return 0;
+ return rtc_register_device(mt2712_rtc->rtc);
}
#ifdef CONFIG_PM_SLEEP