aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-17 11:02:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-17 11:02:04 -0400
commita085963a2757b9ab0a7ec1cf4a14aa85935c1e2a (patch)
tree65ba9b826cf1b2311534e10b944175a83467d654 /drivers/rtc
parentc1d10d18c542278b7fbc413c289d3cb6219da6b3 (diff)
parent07f4beb0b5bbfaf36a64aa00d59e670ec578a95a (diff)
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: tick: Clear broadcast active bit when switching to oneshot rtc: mc13xxx: Don't call rtc_device_register while holding lock rtc: rp5c01: Initialize drvdata before registering device rtc: pcap: Initialize drvdata before registering device rtc: msm6242: Initialize drvdata before registering device rtc: max8998: Initialize drvdata before registering device rtc: max8925: Initialize drvdata before registering device rtc: m41t80: Initialize clientdata before registering device rtc: ds1286: Initialize drvdata before registering device rtc: ep93xx: Initialize drvdata before registering device rtc: davinci: Initialize drvdata before registering device rtc: mxc: Initialize drvdata before registering device clocksource: Install completely before selecting
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-davinci.c5
-rw-r--r--drivers/rtc/rtc-ds1286.c2
-rw-r--r--drivers/rtc/rtc-ep93xx.c5
-rw-r--r--drivers/rtc/rtc-m41t80.c5
-rw-r--r--drivers/rtc/rtc-max8925.c5
-rw-r--r--drivers/rtc/rtc-max8998.c5
-rw-r--r--drivers/rtc/rtc-mc13xxx.c8
-rw-r--r--drivers/rtc/rtc-msm6242.c3
-rw-r--r--drivers/rtc/rtc-mxc.c19
-rw-r--r--drivers/rtc/rtc-pcap.c4
-rw-r--r--drivers/rtc/rtc-rp5c01.c5
11 files changed, 40 insertions, 26 deletions
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index 8d46838dff8a..755e1fe914af 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -524,6 +524,8 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
524 goto fail2; 524 goto fail2;
525 } 525 }
526 526
527 platform_set_drvdata(pdev, davinci_rtc);
528
527 davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, 529 davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
528 &davinci_rtc_ops, THIS_MODULE); 530 &davinci_rtc_ops, THIS_MODULE);
529 if (IS_ERR(davinci_rtc->rtc)) { 531 if (IS_ERR(davinci_rtc->rtc)) {
@@ -553,8 +555,6 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
553 555
554 rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL); 556 rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL);
555 557
556 platform_set_drvdata(pdev, davinci_rtc);
557
558 device_init_wakeup(&pdev->dev, 0); 558 device_init_wakeup(&pdev->dev, 0);
559 559
560 return 0; 560 return 0;
@@ -562,6 +562,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
562fail4: 562fail4:
563 rtc_device_unregister(davinci_rtc->rtc); 563 rtc_device_unregister(davinci_rtc->rtc);
564fail3: 564fail3:
565 platform_set_drvdata(pdev, NULL);
565 iounmap(davinci_rtc->base); 566 iounmap(davinci_rtc->base);
566fail2: 567fail2:
567 release_mem_region(davinci_rtc->pbase, davinci_rtc->base_size); 568 release_mem_region(davinci_rtc->pbase, davinci_rtc->base_size);
diff --git a/drivers/rtc/rtc-ds1286.c b/drivers/rtc/rtc-ds1286.c
index 60ce69600828..47e681df31e2 100644
--- a/drivers/rtc/rtc-ds1286.c
+++ b/drivers/rtc/rtc-ds1286.c
@@ -355,6 +355,7 @@ static int __devinit ds1286_probe(struct platform_device *pdev)
355 goto out; 355 goto out;
356 } 356 }
357 spin_lock_init(&priv->lock); 357 spin_lock_init(&priv->lock);
358 platform_set_drvdata(pdev, priv);
358 rtc = rtc_device_register("ds1286", &pdev->dev, 359 rtc = rtc_device_register("ds1286", &pdev->dev,
359 &ds1286_ops, THIS_MODULE); 360 &ds1286_ops, THIS_MODULE);
360 if (IS_ERR(rtc)) { 361 if (IS_ERR(rtc)) {
@@ -362,7 +363,6 @@ static int __devinit ds1286_probe(struct platform_device *pdev)
362 goto out; 363 goto out;
363 } 364 }
364 priv->rtc = rtc; 365 priv->rtc = rtc;
365 platform_set_drvdata(pdev, priv);
366 return 0; 366 return 0;
367 367
368out: 368out:
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index 11ae64dcbf3c..335551d333b2 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -151,6 +151,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
151 return -ENXIO; 151 return -ENXIO;
152 152
153 pdev->dev.platform_data = ep93xx_rtc; 153 pdev->dev.platform_data = ep93xx_rtc;
154 platform_set_drvdata(pdev, rtc);
154 155
155 rtc = rtc_device_register(pdev->name, 156 rtc = rtc_device_register(pdev->name,
156 &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE); 157 &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE);
@@ -159,8 +160,6 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
159 goto exit; 160 goto exit;
160 } 161 }
161 162
162 platform_set_drvdata(pdev, rtc);
163
164 err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); 163 err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
165 if (err) 164 if (err)
166 goto fail; 165 goto fail;
@@ -168,9 +167,9 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
168 return 0; 167 return 0;
169 168
170fail: 169fail:
171 platform_set_drvdata(pdev, NULL);
172 rtc_device_unregister(rtc); 170 rtc_device_unregister(rtc);
173exit: 171exit:
172 platform_set_drvdata(pdev, NULL);
174 pdev->dev.platform_data = NULL; 173 pdev->dev.platform_data = NULL;
175 return err; 174 return err;
176} 175}
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 69fe664a2228..eda128fc1d38 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -783,6 +783,9 @@ static int m41t80_probe(struct i2c_client *client,
783 goto exit; 783 goto exit;
784 } 784 }
785 785
786 clientdata->features = id->driver_data;
787 i2c_set_clientdata(client, clientdata);
788
786 rtc = rtc_device_register(client->name, &client->dev, 789 rtc = rtc_device_register(client->name, &client->dev,
787 &m41t80_rtc_ops, THIS_MODULE); 790 &m41t80_rtc_ops, THIS_MODULE);
788 if (IS_ERR(rtc)) { 791 if (IS_ERR(rtc)) {
@@ -792,8 +795,6 @@ static int m41t80_probe(struct i2c_client *client,
792 } 795 }
793 796
794 clientdata->rtc = rtc; 797 clientdata->rtc = rtc;
795 clientdata->features = id->driver_data;
796 i2c_set_clientdata(client, clientdata);
797 798
798 /* Make sure HT (Halt Update) bit is cleared */ 799 /* Make sure HT (Halt Update) bit is cleared */
799 rc = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_HOUR); 800 rc = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_HOUR);
diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c
index 20494b5edc3c..3bc046f427e0 100644
--- a/drivers/rtc/rtc-max8925.c
+++ b/drivers/rtc/rtc-max8925.c
@@ -258,6 +258,8 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
258 } 258 }
259 259
260 dev_set_drvdata(&pdev->dev, info); 260 dev_set_drvdata(&pdev->dev, info);
261 /* XXX - isn't this redundant? */
262 platform_set_drvdata(pdev, info);
261 263
262 info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev, 264 info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev,
263 &max8925_rtc_ops, THIS_MODULE); 265 &max8925_rtc_ops, THIS_MODULE);
@@ -267,10 +269,9 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
267 goto out_rtc; 269 goto out_rtc;
268 } 270 }
269 271
270 platform_set_drvdata(pdev, info);
271
272 return 0; 272 return 0;
273out_rtc: 273out_rtc:
274 platform_set_drvdata(pdev, NULL);
274 free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); 275 free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info);
275out_irq: 276out_irq:
276 kfree(info); 277 kfree(info);
diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index 3f7bc6b9fefa..2e48aa604273 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -265,6 +265,8 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev)
265 info->rtc = max8998->rtc; 265 info->rtc = max8998->rtc;
266 info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0; 266 info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0;
267 267
268 platform_set_drvdata(pdev, info);
269
268 info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev, 270 info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev,
269 &max8998_rtc_ops, THIS_MODULE); 271 &max8998_rtc_ops, THIS_MODULE);
270 272
@@ -274,8 +276,6 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev)
274 goto out_rtc; 276 goto out_rtc;
275 } 277 }
276 278
277 platform_set_drvdata(pdev, info);
278
279 ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0, 279 ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0,
280 "rtc-alarm0", info); 280 "rtc-alarm0", info);
281 281
@@ -293,6 +293,7 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev)
293 return 0; 293 return 0;
294 294
295out_rtc: 295out_rtc:
296 platform_set_drvdata(pdev, NULL);
296 kfree(info); 297 kfree(info);
297 return ret; 298 return ret;
298} 299}
diff --git a/drivers/rtc/rtc-mc13xxx.c b/drivers/rtc/rtc-mc13xxx.c
index c5ac03793e79..a1a278bc340d 100644
--- a/drivers/rtc/rtc-mc13xxx.c
+++ b/drivers/rtc/rtc-mc13xxx.c
@@ -349,11 +349,15 @@ static int __devinit mc13xxx_rtc_probe(struct platform_device *pdev)
349 if (ret) 349 if (ret)
350 goto err_alarm_irq_request; 350 goto err_alarm_irq_request;
351 351
352 mc13xxx_unlock(mc13xxx);
353
352 priv->rtc = rtc_device_register(pdev->name, 354 priv->rtc = rtc_device_register(pdev->name,
353 &pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE); 355 &pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE);
354 if (IS_ERR(priv->rtc)) { 356 if (IS_ERR(priv->rtc)) {
355 ret = PTR_ERR(priv->rtc); 357 ret = PTR_ERR(priv->rtc);
356 358
359 mc13xxx_lock(mc13xxx);
360
357 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_TODA, priv); 361 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_TODA, priv);
358err_alarm_irq_request: 362err_alarm_irq_request:
359 363
@@ -365,12 +369,12 @@ err_reset_irq_status:
365 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_RTCRST, priv); 369 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_RTCRST, priv);
366err_reset_irq_request: 370err_reset_irq_request:
367 371
372 mc13xxx_unlock(mc13xxx);
373
368 platform_set_drvdata(pdev, NULL); 374 platform_set_drvdata(pdev, NULL);
369 kfree(priv); 375 kfree(priv);
370 } 376 }
371 377
372 mc13xxx_unlock(mc13xxx);
373
374 return ret; 378 return ret;
375} 379}
376 380
diff --git a/drivers/rtc/rtc-msm6242.c b/drivers/rtc/rtc-msm6242.c
index 67820626e18f..fcb113c11122 100644
--- a/drivers/rtc/rtc-msm6242.c
+++ b/drivers/rtc/rtc-msm6242.c
@@ -214,6 +214,7 @@ static int __init msm6242_rtc_probe(struct platform_device *dev)
214 error = -ENOMEM; 214 error = -ENOMEM;
215 goto out_free_priv; 215 goto out_free_priv;
216 } 216 }
217 platform_set_drvdata(dev, priv);
217 218
218 rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops, 219 rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops,
219 THIS_MODULE); 220 THIS_MODULE);
@@ -223,10 +224,10 @@ static int __init msm6242_rtc_probe(struct platform_device *dev)
223 } 224 }
224 225
225 priv->rtc = rtc; 226 priv->rtc = rtc;
226 platform_set_drvdata(dev, priv);
227 return 0; 227 return 0;
228 228
229out_unmap: 229out_unmap:
230 platform_set_drvdata(dev, NULL);
230 iounmap(priv->regs); 231 iounmap(priv->regs);
231out_free_priv: 232out_free_priv:
232 kfree(priv); 233 kfree(priv);
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 826ab64a8fa9..d814417bee8c 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -418,14 +418,6 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
418 goto exit_put_clk; 418 goto exit_put_clk;
419 } 419 }
420 420
421 rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
422 THIS_MODULE);
423 if (IS_ERR(rtc)) {
424 ret = PTR_ERR(rtc);
425 goto exit_put_clk;
426 }
427
428 pdata->rtc = rtc;
429 platform_set_drvdata(pdev, pdata); 421 platform_set_drvdata(pdev, pdata);
430 422
431 /* Configure and enable the RTC */ 423 /* Configure and enable the RTC */
@@ -438,8 +430,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
438 pdata->irq = -1; 430 pdata->irq = -1;
439 } 431 }
440 432
433 rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
434 THIS_MODULE);
435 if (IS_ERR(rtc)) {
436 ret = PTR_ERR(rtc);
437 goto exit_clr_drvdata;
438 }
439
440 pdata->rtc = rtc;
441
441 return 0; 442 return 0;
442 443
444exit_clr_drvdata:
445 platform_set_drvdata(pdev, NULL);
443exit_put_clk: 446exit_put_clk:
444 clk_disable(pdata->clk); 447 clk_disable(pdata->clk);
445 clk_put(pdata->clk); 448 clk_put(pdata->clk);
diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c
index a633abc42896..cd4f198cc2ef 100644
--- a/drivers/rtc/rtc-pcap.c
+++ b/drivers/rtc/rtc-pcap.c
@@ -151,6 +151,8 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev)
151 151
152 pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent); 152 pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent);
153 153
154 platform_set_drvdata(pdev, pcap_rtc);
155
154 pcap_rtc->rtc = rtc_device_register("pcap", &pdev->dev, 156 pcap_rtc->rtc = rtc_device_register("pcap", &pdev->dev,
155 &pcap_rtc_ops, THIS_MODULE); 157 &pcap_rtc_ops, THIS_MODULE);
156 if (IS_ERR(pcap_rtc->rtc)) { 158 if (IS_ERR(pcap_rtc->rtc)) {
@@ -158,7 +160,6 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev)
158 goto fail_rtc; 160 goto fail_rtc;
159 } 161 }
160 162
161 platform_set_drvdata(pdev, pcap_rtc);
162 163
163 timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ); 164 timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ);
164 alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA); 165 alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA);
@@ -177,6 +178,7 @@ fail_alarm:
177fail_timer: 178fail_timer:
178 rtc_device_unregister(pcap_rtc->rtc); 179 rtc_device_unregister(pcap_rtc->rtc);
179fail_rtc: 180fail_rtc:
181 platform_set_drvdata(pdev, NULL);
180 kfree(pcap_rtc); 182 kfree(pcap_rtc);
181 return err; 183 return err;
182} 184}
diff --git a/drivers/rtc/rtc-rp5c01.c b/drivers/rtc/rtc-rp5c01.c
index 694da39b6dd2..359da6d020b9 100644
--- a/drivers/rtc/rtc-rp5c01.c
+++ b/drivers/rtc/rtc-rp5c01.c
@@ -249,15 +249,15 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev)
249 249
250 spin_lock_init(&priv->lock); 250 spin_lock_init(&priv->lock);
251 251
252 platform_set_drvdata(dev, priv);
253
252 rtc = rtc_device_register("rtc-rp5c01", &dev->dev, &rp5c01_rtc_ops, 254 rtc = rtc_device_register("rtc-rp5c01", &dev->dev, &rp5c01_rtc_ops,
253 THIS_MODULE); 255 THIS_MODULE);
254 if (IS_ERR(rtc)) { 256 if (IS_ERR(rtc)) {
255 error = PTR_ERR(rtc); 257 error = PTR_ERR(rtc);
256 goto out_unmap; 258 goto out_unmap;
257 } 259 }
258
259 priv->rtc = rtc; 260 priv->rtc = rtc;
260 platform_set_drvdata(dev, priv);
261 261
262 error = sysfs_create_bin_file(&dev->dev.kobj, &priv->nvram_attr); 262 error = sysfs_create_bin_file(&dev->dev.kobj, &priv->nvram_attr);
263 if (error) 263 if (error)
@@ -268,6 +268,7 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev)
268out_unregister: 268out_unregister:
269 rtc_device_unregister(rtc); 269 rtc_device_unregister(rtc);
270out_unmap: 270out_unmap:
271 platform_set_drvdata(dev, NULL);
271 iounmap(priv->regs); 272 iounmap(priv->regs);
272out_free_priv: 273out_free_priv:
273 kfree(priv); 274 kfree(priv);