From: Alexandre Belloni Date: Mon, 12 Feb 2018 22:47:57 +0000 (+0100) Subject: rtc: tx4939: switch to rtc_register_device X-Git-Tag: v4.19~1240^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68981fd1515de16f8effdd39e81f9a6084a895f7;p=platform%2Fkernel%2Flinux-rpi.git rtc: tx4939: switch to rtc_register_device This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-tx4939.c b/drivers/rtc/rtc-tx4939.c index 1f4013d..75c3887 100644 --- a/drivers/rtc/rtc-tx4939.c +++ b/drivers/rtc/rtc-tx4939.c @@ -283,10 +283,16 @@ static int __init tx4939_rtc_probe(struct platform_device *pdev) if (devm_request_irq(&pdev->dev, irq, tx4939_rtc_interrupt, 0, pdev->name, &pdev->dev) < 0) return -EBUSY; - rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &tx4939_rtc_ops, THIS_MODULE); + rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc)) return PTR_ERR(rtc); + + rtc->ops = &tx4939_rtc_ops; + + ret = rtc_register_device(rtc); + if (ret) + return ret; + pdata->rtc = rtc; ret = sysfs_create_bin_file(&pdev->dev.kobj, &tx4939_rtc_nvram_attr);