diff options
| author | Evan Wilson <evan@oliodevices.com> | 2015-09-02 02:15:23 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit2@ip-172-31-25-77.us-west-1.compute.internal> | 2015-04-16 10:08:13 +0000 |
| commit | 8f5e029c522d0bfaa9bbc55281e6a76e37afa15c (patch) | |
| tree | b19949639f0b8147efcc87845c9f669e790e312c /drivers/rtc | |
| parent | 8e34a8edb6eeabda46ce4011d0147dce82610d50 (diff) | |
| parent | 3c3e312f0eb93dada915935c318d965978faabb2 (diff) | |
| download | olio-linux-3.10-8f5e029c522d0bfaa9bbc55281e6a76e37afa15c.tar.xz olio-linux-3.10-8f5e029c522d0bfaa9bbc55281e6a76e37afa15c.zip | |
Merge "Fixing bug in the rtc driver that stopped the rtc device from getting registered properly and thereby blocked time and alarm from working properly." into android-3.10-bringup
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | drivers/rtc/rtc-tps65910.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index cdbf1a2b251..2e4894b4732 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -238,17 +238,20 @@ static int tps65910_rtc_probe(struct platform_device *pdev) tps_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps65910_rtc), GFP_KERNEL); - if (!tps_rtc) - return -ENOMEM; + + if (!tps_rtc) { + ret = -ENOMEM; + goto fail_end; + } /* Clear pending interrupts */ ret = regmap_read(tps65910->regmap, TPS65910_RTC_STATUS, &rtc_reg); if (ret < 0) - return ret; + goto fail_end; ret = regmap_write(tps65910->regmap, TPS65910_RTC_STATUS, rtc_reg); if (ret < 0) - return ret; + goto fail_end; dev_dbg(&pdev->dev, "Enabling rtc-tps65910.\n"); @@ -256,18 +259,19 @@ static int tps65910_rtc_probe(struct platform_device *pdev) ret = regmap_update_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_RTC_PWDN_MASK, 0 << DEVCTRL_RTC_PWDN_SHIFT); if (ret < 0) - return ret; + goto fail_end; rtc_reg = TPS65910_RTC_CTRL_STOP_RTC; ret = regmap_write(tps65910->regmap, TPS65910_RTC_CTRL, rtc_reg); if (ret < 0) - return ret; + goto fail_end; irq = platform_get_irq(pdev, 0); if (irq <= 0) { dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n", - irq); - return -ENXIO; + irq); + ret = -ENXIO; + goto fail_end; } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, @@ -275,23 +279,28 @@ static int tps65910_rtc_probe(struct platform_device *pdev) dev_name(&pdev->dev), &pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "IRQ is not free.\n"); - return ret; + goto fail_end; } tps_rtc->irq = irq; - device_set_wakeup_capable(&pdev->dev, 1); + + device_init_wakeup(&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); dev_err(&pdev->dev, "RTC device register: err %d\n", ret); - return ret; + goto fail_end; } platform_set_drvdata(pdev, tps_rtc); + wake_lock_init(&rtc_wake_lock, WAKE_LOCK_SUSPEND, "rtc_wake_lock"); return 0; + +fail_end: + return ret; } /* |