From e99fab69b510bdc8db598130c1edac7cfec07e1a Mon Sep 17 00:00:00 2001 From: Wei Ni Date: Wed, 19 Oct 2011 13:29:49 +0800 Subject: rtc: tps6586x: Fix for proper wakealarm In the driver probe function, call device_init_wakeup() before registering rtc device, so that wakealarm sysfs will be created. BUG=889820 Change-Id: I957fdffb02cd7e43dd96db0794e2e9f8dc7bd3ee Signed-off-by: Wei Ni Reviewed-on: http://git-master/r/58937 Reviewed-by: Allen Martin Reviewed-on: http://git-master/r/63244 Rebase-Id: R9e078974bd9e773443b19492b83d25694f4582c2 --- drivers/rtc/rtc-tps6586x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c index 8415993e98f7..c41edabf0b2c 100644 --- a/drivers/rtc/rtc-tps6586x.c +++ b/drivers/rtc/rtc-tps6586x.c @@ -304,6 +304,9 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) epoch->hour, epoch->min, epoch->sec); dev_set_drvdata(&pdev->dev, rtc); + + device_init_wakeup(&pdev->dev, 1); + rtc->rtc = rtc_device_register("tps6586x-rtc", &pdev->dev, &tps6586x_rtc_ops, THIS_MODULE); @@ -331,7 +334,6 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) dev_warn(&pdev->dev, "unable to request IRQ(%d)\n", rtc->irq); rtc->irq = -1; } else { - device_init_wakeup(&pdev->dev, 1); enable_irq_wake(rtc->irq); disable_irq(rtc->irq); } @@ -342,6 +344,7 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) fail: if (!IS_ERR_OR_NULL(rtc->rtc)) rtc_device_unregister(rtc->rtc); + device_init_wakeup(&pdev->dev, 0); kfree(rtc); return err; } -- cgit v1.2.3