aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2012-03-12 00:21:58 -0400
committerWim Van Sebroeck <wim@iguana.be>2012-03-27 14:14:11 -0400
commitaa065770f55f44ed24f0a9b76ec6e2135264d43b (patch)
tree73f4752a5ef564beed945b4a55d24f7557dd228a
parent38c484fa136f66224694af298f80e96bf4072700 (diff)
watchdog: mpcore_wdt: Rename dev to pdev for pointing to struct platform_device
Pointer to struct platform_device is named as dev, which makes it confusing when we write statements like dev->dev to access struct device within it. This patch renames such names to pdev. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r--drivers/watchdog/mpcore_wdt.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
index 9e83f333b250..ca0810ed00a8 100644
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
@@ -47,7 +47,7 @@ struct mpcore_wdt {
47 char expect_close; 47 char expect_close;
48}; 48};
49 49
50static struct platform_device *mpcore_wdt_dev; 50static struct platform_device *mpcore_wdt_pdev;
51static DEFINE_SPINLOCK(wdt_lock); 51static DEFINE_SPINLOCK(wdt_lock);
52 52
53#define TIMER_MARGIN 60 53#define TIMER_MARGIN 60
@@ -151,7 +151,7 @@ static int mpcore_wdt_set_heartbeat(int t)
151 */ 151 */
152static int mpcore_wdt_open(struct inode *inode, struct file *file) 152static int mpcore_wdt_open(struct inode *inode, struct file *file)
153{ 153{
154 struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_dev); 154 struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_pdev);
155 155
156 if (test_and_set_bit(0, &wdt->timer_alive)) 156 if (test_and_set_bit(0, &wdt->timer_alive))
157 return -EBUSY; 157 return -EBUSY;
@@ -301,9 +301,9 @@ static long mpcore_wdt_ioctl(struct file *file, unsigned int cmd,
301 * System shutdown handler. Turn off the watchdog if we're 301 * System shutdown handler. Turn off the watchdog if we're
302 * restarting or halting the system. 302 * restarting or halting the system.
303 */ 303 */
304static void mpcore_wdt_shutdown(struct platform_device *dev) 304static void mpcore_wdt_shutdown(struct platform_device *pdev)
305{ 305{
306 struct mpcore_wdt *wdt = platform_get_drvdata(dev); 306 struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
307 307
308 if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT) 308 if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT)
309 mpcore_wdt_stop(wdt); 309 mpcore_wdt_stop(wdt);
@@ -327,17 +327,17 @@ static struct miscdevice mpcore_wdt_miscdev = {
327 .fops = &mpcore_wdt_fops, 327 .fops = &mpcore_wdt_fops,
328}; 328};
329 329
330static int __devinit mpcore_wdt_probe(struct platform_device *dev) 330static int __devinit mpcore_wdt_probe(struct platform_device *pdev)
331{ 331{
332 struct mpcore_wdt *wdt; 332 struct mpcore_wdt *wdt;
333 struct resource *res; 333 struct resource *res;
334 int ret; 334 int ret;
335 335
336 /* We only accept one device, and it must have an id of -1 */ 336 /* We only accept one device, and it must have an id of -1 */
337 if (dev->id != -1) 337 if (pdev->id != -1)
338 return -ENODEV; 338 return -ENODEV;
339 339
340 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 340 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
341 if (!res) { 341 if (!res) {
342 ret = -ENODEV; 342 ret = -ENODEV;
343 goto err_out; 343 goto err_out;
@@ -349,8 +349,8 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
349 goto err_out; 349 goto err_out;
350 } 350 }
351 351
352 wdt->dev = &dev->dev; 352 wdt->dev = &pdev->dev;
353 wdt->irq = platform_get_irq(dev, 0); 353 wdt->irq = platform_get_irq(pdev, 0);
354 if (wdt->irq < 0) { 354 if (wdt->irq < 0) {
355 ret = -ENXIO; 355 ret = -ENXIO;
356 goto err_free; 356 goto err_free;
@@ -361,7 +361,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
361 goto err_free; 361 goto err_free;
362 } 362 }
363 363
364 mpcore_wdt_miscdev.parent = &dev->dev; 364 mpcore_wdt_miscdev.parent = &pdev->dev;
365 ret = misc_register(&mpcore_wdt_miscdev); 365 ret = misc_register(&mpcore_wdt_miscdev);
366 if (ret) { 366 if (ret) {
367 dev_printk(KERN_ERR, wdt->dev, 367 dev_printk(KERN_ERR, wdt->dev,
@@ -378,8 +378,8 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
378 } 378 }
379 379
380 mpcore_wdt_stop(wdt); 380 mpcore_wdt_stop(wdt);
381 platform_set_drvdata(dev, wdt); 381 platform_set_drvdata(pdev, wdt);
382 mpcore_wdt_dev = dev; 382 mpcore_wdt_pdev = pdev;
383 383
384 return 0; 384 return 0;
385 385
@@ -393,15 +393,15 @@ err_out:
393 return ret; 393 return ret;
394} 394}
395 395
396static int __devexit mpcore_wdt_remove(struct platform_device *dev) 396static int __devexit mpcore_wdt_remove(struct platform_device *pdev)
397{ 397{
398 struct mpcore_wdt *wdt = platform_get_drvdata(dev); 398 struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
399 399
400 platform_set_drvdata(dev, NULL); 400 platform_set_drvdata(pdev, NULL);
401 401
402 misc_deregister(&mpcore_wdt_miscdev); 402 misc_deregister(&mpcore_wdt_miscdev);
403 403
404 mpcore_wdt_dev = NULL; 404 mpcore_wdt_pdev = NULL;
405 405
406 free_irq(wdt->irq, wdt); 406 free_irq(wdt->irq, wdt);
407 iounmap(wdt->base); 407 iounmap(wdt->base);
@@ -410,16 +410,16 @@ static int __devexit mpcore_wdt_remove(struct platform_device *dev)
410} 410}
411 411
412#ifdef CONFIG_PM 412#ifdef CONFIG_PM
413static int mpcore_wdt_suspend(struct platform_device *dev, pm_message_t msg) 413static int mpcore_wdt_suspend(struct platform_device *pdev, pm_message_t msg)
414{ 414{
415 struct mpcore_wdt *wdt = platform_get_drvdata(dev); 415 struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
416 mpcore_wdt_stop(wdt); /* Turn the WDT off */ 416 mpcore_wdt_stop(wdt); /* Turn the WDT off */
417 return 0; 417 return 0;
418} 418}
419 419
420static int mpcore_wdt_resume(struct platform_device *dev) 420static int mpcore_wdt_resume(struct platform_device *pdev)
421{ 421{
422 struct mpcore_wdt *wdt = platform_get_drvdata(dev); 422 struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
423 /* re-activate timer */ 423 /* re-activate timer */
424 if (test_bit(0, &wdt->timer_alive)) 424 if (test_bit(0, &wdt->timer_alive))
425 mpcore_wdt_start(wdt); 425 mpcore_wdt_start(wdt);