Skip to content

Commit

Permalink
rtc: rtc-pl031: Set wakeup flag prior to registering rtcdev
Browse files Browse the repository at this point in the history
In some recent testing, I noticed the CLOCK_REALTIME_ALARM clockid
wasn't functioning on my vexpress qemu environment. Looking into it
I noticed the pl031 rtc driver doesn't set the wakeup flag on the
device until after registering the device with the RTC subsystem.

This causes the alarmtimer subsystem to not see the pl031 driver
as a valid backing device, and that resuls in alarm clockids
getting ENOTSUPP errors.

Thus be sure to set the wakeup flag on the device prior to
registering the rtcdev so the pl031 rtc driver can be used as
the backing alarmtimer device.

Cc: Linus Walleij <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: "Jon Medhurst (Tixy)" <[email protected]>
Cc: [email protected]
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: John Stultz <[email protected]>
  • Loading branch information
johnstultz-work committed Sep 18, 2013
1 parent 233bcb4 commit 0778339
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/rtc/rtc-pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
}
}

device_init_wakeup(&adev->dev, 1);
ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
THIS_MODULE);
if (IS_ERR(ldata->rtc)) {
Expand All @@ -384,8 +385,6 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
goto out_no_irq;
}

device_init_wakeup(&adev->dev, 1);

return 0;

out_no_irq:
Expand Down

0 comments on commit 0778339

Please sign in to comment.