diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:19:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:30 -0400 |
commit | 360fe134e2808fee04b73406424295d18d09ee85 (patch) | |
tree | a020acf84e97faf92c74761dd1c857d6ba2b6c67 /drivers/rtc/rtc-generic.c | |
parent | 019b21d07a91e41c2f0dbc8d2c2c7afee6ba4994 (diff) |
rtc: rtc-generic: 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>
Diffstat (limited to 'drivers/rtc/rtc-generic.c')
-rw-r--r-- | drivers/rtc/rtc-generic.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-generic.c b/drivers/rtc/rtc-generic.c index 0bf4530e18b0..06279ce6bff2 100644 --- a/drivers/rtc/rtc-generic.c +++ b/drivers/rtc/rtc-generic.c | |||
@@ -38,8 +38,8 @@ static int __init generic_rtc_probe(struct platform_device *dev) | |||
38 | { | 38 | { |
39 | struct rtc_device *rtc; | 39 | struct rtc_device *rtc; |
40 | 40 | ||
41 | rtc = rtc_device_register("rtc-generic", &dev->dev, &generic_rtc_ops, | 41 | rtc = devm_rtc_device_register(&dev->dev, "rtc-generic", |
42 | THIS_MODULE); | 42 | &generic_rtc_ops, THIS_MODULE); |
43 | if (IS_ERR(rtc)) | 43 | if (IS_ERR(rtc)) |
44 | return PTR_ERR(rtc); | 44 | return PTR_ERR(rtc); |
45 | 45 | ||
@@ -50,10 +50,6 @@ static int __init generic_rtc_probe(struct platform_device *dev) | |||
50 | 50 | ||
51 | static int __exit generic_rtc_remove(struct platform_device *dev) | 51 | static int __exit generic_rtc_remove(struct platform_device *dev) |
52 | { | 52 | { |
53 | struct rtc_device *rtc = platform_get_drvdata(dev); | ||
54 | |||
55 | rtc_device_unregister(rtc); | ||
56 | |||
57 | return 0; | 53 | return 0; |
58 | } | 54 | } |
59 | 55 | ||