Commit 288031bfef43b39b12dcaaad6b950d4742620243
Committed by
Linus Torvalds
1 parent
27971335ce
Exists in
master
and in
20 other branches
rtc: rtc-pcf8523: use devm_rtc_device_register()
devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 1 additions and 5 deletions Side-by-side Diff
drivers/rtc/rtc-pcf8523.c
... | ... | @@ -307,7 +307,7 @@ |
307 | 307 | if (err < 0) |
308 | 308 | return err; |
309 | 309 | |
310 | - pcf->rtc = rtc_device_register(DRIVER_NAME, &client->dev, | |
310 | + pcf->rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME, | |
311 | 311 | &pcf8523_rtc_ops, THIS_MODULE); |
312 | 312 | if (IS_ERR(pcf->rtc)) |
313 | 313 | return PTR_ERR(pcf->rtc); |
... | ... | @@ -319,10 +319,6 @@ |
319 | 319 | |
320 | 320 | static int pcf8523_remove(struct i2c_client *client) |
321 | 321 | { |
322 | - struct pcf8523 *pcf = i2c_get_clientdata(client); | |
323 | - | |
324 | - rtc_device_unregister(pcf->rtc); | |
325 | - | |
326 | 322 | return 0; |
327 | 323 | } |
328 | 324 |