aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2022-03-09 17:22:54 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2022-03-23 19:58:40 +0100
commit8aa74363969f172c845b270b47a3d22871d7e156 (patch)
treed0dc9b3645db2c490dd58347e00490f94c668ba7 /drivers/rtc
parentrtc: add new RTC_FEATURE_ALARM_WAKEUP_ONLY feature (diff)
downloadlinux-dev-8aa74363969f172c845b270b47a3d22871d7e156.tar.xz
linux-dev-8aa74363969f172c845b270b47a3d22871d7e156.zip
rtc: efi: switch to devm_rtc_allocate_device
Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows for further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220309162301.61679-23-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-efi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index 138c5e0046c8..0c0e382c22e2 100644
--- a/drivers/rtc/rtc-efi.c
+++ b/drivers/rtc/rtc-efi.c
@@ -261,15 +261,16 @@ static int __init efi_rtc_probe(struct platform_device *dev)
if (efi.get_time(&eft, &cap) != EFI_SUCCESS)
return -ENODEV;
- rtc = devm_rtc_device_register(&dev->dev, "rtc-efi", &efi_rtc_ops,
- THIS_MODULE);
+ rtc = devm_rtc_allocate_device(&dev->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
- rtc->uie_unsupported = 1;
platform_set_drvdata(dev, rtc);
- return 0;
+ rtc->ops = &efi_rtc_ops;
+ rtc->uie_unsupported = 1;
+
+ return devm_rtc_register_device(rtc);
}
static struct platform_driver efi_rtc_driver = {