Skip to content

Commit

Permalink
rtc: isl12022: stop using deprecated devm_rtc_device_register()
Browse files Browse the repository at this point in the history
The comments say that devm_rtc_device_register() is deprecated and
that one should instead use devm_rtc_allocate_device() and
[devm_]rtc_register_device. So do that.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20220921114624.3250848-2-linux@rasmusvillemoes.dk
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
  • Loading branch information
Villemoes authored and alexandrebelloni committed Oct 12, 2022
1 parent 0759011 commit a35a2ad
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/rtc/rtc-isl12022.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,13 @@ static int isl12022_probe(struct i2c_client *client)

i2c_set_clientdata(client, isl12022);

isl12022->rtc = devm_rtc_device_register(&client->dev,
isl12022_driver.driver.name,
&isl12022_rtc_ops, THIS_MODULE);
return PTR_ERR_OR_ZERO(isl12022->rtc);
isl12022->rtc = devm_rtc_allocate_device(&client->dev);
if (IS_ERR(isl12022->rtc))
return PTR_ERR(isl12022->rtc);

isl12022->rtc->ops = &isl12022_rtc_ops;

return devm_rtc_register_device(isl12022->rtc);
}

#ifdef CONFIG_OF
Expand Down

0 comments on commit a35a2ad

Please sign in to comment.