aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-07-03 18:06:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:49 -0400
commit46aee0c7829794cdc18ba96d4d0fb3e3cd646577 (patch)
tree7396706063264b0c1f9004dedb8fbef099770cb6 /drivers/rtc
parent431296a4cf0e9c951457cf3f6786760f63dee7f5 (diff)
rtc: rtc-at32ap700x: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. 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')
-rw-r--r--drivers/rtc/rtc-at32ap700x.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c
index 128896da1a14..3161ab5263ed 100644
--- a/drivers/rtc/rtc-at32ap700x.c
+++ b/drivers/rtc/rtc-at32ap700x.c
@@ -212,23 +212,20 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
212 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 212 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
213 if (!regs) { 213 if (!regs) {
214 dev_dbg(&pdev->dev, "no mmio resource defined\n"); 214 dev_dbg(&pdev->dev, "no mmio resource defined\n");
215 ret = -ENXIO; 215 return -ENXIO;
216 goto out;
217 } 216 }
218 217
219 irq = platform_get_irq(pdev, 0); 218 irq = platform_get_irq(pdev, 0);
220 if (irq <= 0) { 219 if (irq <= 0) {
221 dev_dbg(&pdev->dev, "could not get irq\n"); 220 dev_dbg(&pdev->dev, "could not get irq\n");
222 ret = -ENXIO; 221 return -ENXIO;
223 goto out;
224 } 222 }
225 223
226 rtc->irq = irq; 224 rtc->irq = irq;
227 rtc->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs)); 225 rtc->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
228 if (!rtc->regs) { 226 if (!rtc->regs) {
229 ret = -ENOMEM;
230 dev_dbg(&pdev->dev, "could not map I/O memory\n"); 227 dev_dbg(&pdev->dev, "could not map I/O memory\n");
231 goto out; 228 return -ENOMEM;
232 } 229 }
233 spin_lock_init(&rtc->lock); 230 spin_lock_init(&rtc->lock);
234 231
@@ -249,7 +246,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
249 "rtc", rtc); 246 "rtc", rtc);
250 if (ret) { 247 if (ret) {
251 dev_dbg(&pdev->dev, "could not request irq %d\n", irq); 248 dev_dbg(&pdev->dev, "could not request irq %d\n", irq);
252 goto out; 249 return ret;
253 } 250 }
254 251
255 platform_set_drvdata(pdev, rtc); 252 platform_set_drvdata(pdev, rtc);
@@ -258,8 +255,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
258 &at32_rtc_ops, THIS_MODULE); 255 &at32_rtc_ops, THIS_MODULE);
259 if (IS_ERR(rtc->rtc)) { 256 if (IS_ERR(rtc->rtc)) {
260 dev_dbg(&pdev->dev, "could not register rtc device\n"); 257 dev_dbg(&pdev->dev, "could not register rtc device\n");
261 ret = PTR_ERR(rtc->rtc); 258 return PTR_ERR(rtc->rtc);
262 goto out;
263 } 259 }
264 260
265 device_init_wakeup(&pdev->dev, 1); 261 device_init_wakeup(&pdev->dev, 1);
@@ -268,18 +264,12 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
268 (unsigned long)rtc->regs, rtc->irq); 264 (unsigned long)rtc->regs, rtc->irq);
269 265
270 return 0; 266 return 0;
271
272out:
273 platform_set_drvdata(pdev, NULL);
274 return ret;
275} 267}
276 268
277static int __exit at32_rtc_remove(struct platform_device *pdev) 269static int __exit at32_rtc_remove(struct platform_device *pdev)
278{ 270{
279 device_init_wakeup(&pdev->dev, 0); 271 device_init_wakeup(&pdev->dev, 0);
280 272
281 platform_set_drvdata(pdev, NULL);
282
283 return 0; 273 return 0;
284} 274}
285 275