Skip to content

Commit 8aa7436

Browse files
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
1 parent e99653a commit 8aa7436

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/rtc/rtc-efi.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,16 @@ static int __init efi_rtc_probe(struct platform_device *dev)
261261
if (efi.get_time(&eft, &cap) != EFI_SUCCESS)
262262
return -ENODEV;
263263

264-
rtc = devm_rtc_device_register(&dev->dev, "rtc-efi", &efi_rtc_ops,
265-
THIS_MODULE);
264+
rtc = devm_rtc_allocate_device(&dev->dev);
266265
if (IS_ERR(rtc))
267266
return PTR_ERR(rtc);
268267

269-
rtc->uie_unsupported = 1;
270268
platform_set_drvdata(dev, rtc);
271269

272-
return 0;
270+
rtc->ops = &efi_rtc_ops;
271+
rtc->uie_unsupported = 1;
272+
273+
return devm_rtc_register_device(rtc);
273274
}
274275

275276
static struct platform_driver efi_rtc_driver = {

0 commit comments

Comments
 (0)