From: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx> devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device() and devm_rtc_register_device() pair instead. Signed-off-by: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx> --- drivers/rtc/rtc-moxart.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c index 6b24ac9e1cfa..f354bc8abecf 100644 --- a/drivers/rtc/rtc-moxart.c +++ b/drivers/rtc/rtc-moxart.c @@ -294,15 +294,13 @@ static int moxart_rtc_probe(struct platform_device *pdev) return ret; } - moxart_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &moxart_rtc_ops, - THIS_MODULE); - if (IS_ERR(moxart_rtc->rtc)) { - dev_err(&pdev->dev, "devm_rtc_device_register failed\n"); + moxart_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(moxart_rtc->rtc)) return PTR_ERR(moxart_rtc->rtc); - } - return 0; + moxart_rtc->rtc->ops = &moxart_rtc_ops; + + return devm_rtc_register_device(moxart_rtc->rtc); } static const struct of_device_id moxart_rtc_match[] = { -- 2.29.1