aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:19:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:26 -0400
commit288031bfef43b39b12dcaaad6b950d4742620243 (patch)
tree4936dddc3b794e65bdbb1dd7c7f1b58355d3eb2a
parent27971335ce666feb08344ca7c5fdd25f13985f62 (diff)
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>
-rw-r--r--drivers/rtc/rtc-pcf8523.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c
index 889e3160e701..305c9515e5bb 100644
--- a/drivers/rtc/rtc-pcf8523.c
+++ b/drivers/rtc/rtc-pcf8523.c
@@ -307,7 +307,7 @@ static int pcf8523_probe(struct i2c_client *client,
307 if (err < 0) 307 if (err < 0)
308 return err; 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 &pcf8523_rtc_ops, THIS_MODULE); 311 &pcf8523_rtc_ops, THIS_MODULE);
312 if (IS_ERR(pcf->rtc)) 312 if (IS_ERR(pcf->rtc))
313 return PTR_ERR(pcf->rtc); 313 return PTR_ERR(pcf->rtc);
@@ -319,10 +319,6 @@ static int pcf8523_probe(struct i2c_client *client,
319 319
320static int pcf8523_remove(struct i2c_client *client) 320static 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 return 0; 322 return 0;
327} 323}
328 324