aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-r9701.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:19:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:31 -0400
commit9b6d955aedf84ab5e97cda73c6df9ea17952a3d4 (patch)
tree3af51d8a006281cf5c511094b22008758e6f3872 /drivers/rtc/rtc-r9701.c
parent9dc37c3353a4984792f11f8d2940d9d537f2b64c (diff)
rtc: rtc-r9701: 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-r9701.c')
-rw-r--r--drivers/rtc/rtc-r9701.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c
index 7726f4a4f2d0..0adf5b528129 100644
--- a/drivers/rtc/rtc-r9701.c
+++ b/drivers/rtc/rtc-r9701.c
@@ -154,8 +154,8 @@ static int r9701_probe(struct spi_device *spi)
154 } 154 }
155 } 155 }
156 156
157 rtc = rtc_device_register("r9701", 157 rtc = devm_rtc_device_register(&spi->dev, "r9701",
158 &spi->dev, &r9701_rtc_ops, THIS_MODULE); 158 &r9701_rtc_ops, THIS_MODULE);
159 if (IS_ERR(rtc)) 159 if (IS_ERR(rtc))
160 return PTR_ERR(rtc); 160 return PTR_ERR(rtc);
161 161
@@ -166,9 +166,6 @@ static int r9701_probe(struct spi_device *spi)
166 166
167static int r9701_remove(struct spi_device *spi) 167static int r9701_remove(struct spi_device *spi)
168{ 168{
169 struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
170
171 rtc_device_unregister(rtc);
172 return 0; 169 return 0;
173} 170}
174 171