From: Bartosz Golaszewski <[email protected]>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
 drivers/rtc/rtc-hym8563.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 24e0095be058..f39568c6d390 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -558,11 +558,11 @@ static int hym8563_probe(struct i2c_client *client,
        dev_dbg(&client->dev, "rtc information is %s\n",
                (ret & HYM8563_SEC_VL) ? "invalid" : "valid");
 
-       hym8563->rtc = devm_rtc_device_register(&client->dev, client->name,
-                                               &hym8563_rtc_ops, THIS_MODULE);
+       hym8563->rtc = devm_rtc_allocate_device(&client->dev);
        if (IS_ERR(hym8563->rtc))
                return PTR_ERR(hym8563->rtc);
 
+       hym8563->rtc->ops = &hym8563_rtc_ops;
        /* the hym8563 alarm only supports a minute accuracy */
        hym8563->rtc->uie_unsupported = 1;
 
@@ -570,7 +570,7 @@ static int hym8563_probe(struct i2c_client *client,
        hym8563_clkout_register_clk(hym8563);
 #endif
 
-       return 0;
+       return devm_rtc_register_device(hym8563->rtc);
 }
 
 static const struct i2c_device_id hym8563_id[] = {
-- 
2.29.1

Reply via email to