Skip to content

Commit a35a2ad

Browse files
Villemoesalexandrebelloni
authored andcommitted
rtc: isl12022: stop using deprecated devm_rtc_device_register()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 0759011 commit a35a2ad

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/rtc/rtc-isl12022.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,13 @@ static int isl12022_probe(struct i2c_client *client)
246246

247247
i2c_set_clientdata(client, isl12022);
248248

249-
isl12022->rtc = devm_rtc_device_register(&client->dev,
250-
isl12022_driver.driver.name,
251-
&isl12022_rtc_ops, THIS_MODULE);
252-
return PTR_ERR_OR_ZERO(isl12022->rtc);
249+
isl12022->rtc = devm_rtc_allocate_device(&client->dev);
250+
if (IS_ERR(isl12022->rtc))
251+
return PTR_ERR(isl12022->rtc);
252+
253+
isl12022->rtc->ops = &isl12022_rtc_ops;
254+
255+
return devm_rtc_register_device(isl12022->rtc);
253256
}
254257

255258
#ifdef CONFIG_OF

0 commit comments

Comments
 (0)