mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
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>
This commit is contained in:
parent
38c484fa13
commit
aa065770f5
1 changed files with 20 additions and 20 deletions
|
@ -47,7 +47,7 @@ struct mpcore_wdt {
|
||||||
char expect_close;
|
char expect_close;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device *mpcore_wdt_dev;
|
static struct platform_device *mpcore_wdt_pdev;
|
||||||
static DEFINE_SPINLOCK(wdt_lock);
|
static DEFINE_SPINLOCK(wdt_lock);
|
||||||
|
|
||||||
#define TIMER_MARGIN 60
|
#define TIMER_MARGIN 60
|
||||||
|
@ -151,7 +151,7 @@ static int mpcore_wdt_set_heartbeat(int t)
|
||||||
*/
|
*/
|
||||||
static int mpcore_wdt_open(struct inode *inode, struct file *file)
|
static int mpcore_wdt_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_dev);
|
struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_pdev);
|
||||||
|
|
||||||
if (test_and_set_bit(0, &wdt->timer_alive))
|
if (test_and_set_bit(0, &wdt->timer_alive))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
@ -301,9 +301,9 @@ static long mpcore_wdt_ioctl(struct file *file, unsigned int cmd,
|
||||||
* System shutdown handler. Turn off the watchdog if we're
|
* System shutdown handler. Turn off the watchdog if we're
|
||||||
* restarting or halting the system.
|
* restarting or halting the system.
|
||||||
*/
|
*/
|
||||||
static void mpcore_wdt_shutdown(struct platform_device *dev)
|
static void mpcore_wdt_shutdown(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mpcore_wdt *wdt = platform_get_drvdata(dev);
|
struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT)
|
if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT)
|
||||||
mpcore_wdt_stop(wdt);
|
mpcore_wdt_stop(wdt);
|
||||||
|
@ -327,17 +327,17 @@ static struct miscdevice mpcore_wdt_miscdev = {
|
||||||
.fops = &mpcore_wdt_fops,
|
.fops = &mpcore_wdt_fops,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __devinit mpcore_wdt_probe(struct platform_device *dev)
|
static int __devinit mpcore_wdt_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mpcore_wdt *wdt;
|
struct mpcore_wdt *wdt;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* We only accept one device, and it must have an id of -1 */
|
/* We only accept one device, and it must have an id of -1 */
|
||||||
if (dev->id != -1)
|
if (pdev->id != -1)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
@ -349,8 +349,8 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
wdt->dev = &dev->dev;
|
wdt->dev = &pdev->dev;
|
||||||
wdt->irq = platform_get_irq(dev, 0);
|
wdt->irq = platform_get_irq(pdev, 0);
|
||||||
if (wdt->irq < 0) {
|
if (wdt->irq < 0) {
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
goto err_free;
|
goto err_free;
|
||||||
|
@ -361,7 +361,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
|
||||||
goto err_free;
|
goto err_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
mpcore_wdt_miscdev.parent = &dev->dev;
|
mpcore_wdt_miscdev.parent = &pdev->dev;
|
||||||
ret = misc_register(&mpcore_wdt_miscdev);
|
ret = misc_register(&mpcore_wdt_miscdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_printk(KERN_ERR, wdt->dev,
|
dev_printk(KERN_ERR, wdt->dev,
|
||||||
|
@ -378,8 +378,8 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
mpcore_wdt_stop(wdt);
|
mpcore_wdt_stop(wdt);
|
||||||
platform_set_drvdata(dev, wdt);
|
platform_set_drvdata(pdev, wdt);
|
||||||
mpcore_wdt_dev = dev;
|
mpcore_wdt_pdev = pdev;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -393,15 +393,15 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devexit mpcore_wdt_remove(struct platform_device *dev)
|
static int __devexit mpcore_wdt_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mpcore_wdt *wdt = platform_get_drvdata(dev);
|
struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
platform_set_drvdata(dev, NULL);
|
platform_set_drvdata(pdev, NULL);
|
||||||
|
|
||||||
misc_deregister(&mpcore_wdt_miscdev);
|
misc_deregister(&mpcore_wdt_miscdev);
|
||||||
|
|
||||||
mpcore_wdt_dev = NULL;
|
mpcore_wdt_pdev = NULL;
|
||||||
|
|
||||||
free_irq(wdt->irq, wdt);
|
free_irq(wdt->irq, wdt);
|
||||||
iounmap(wdt->base);
|
iounmap(wdt->base);
|
||||||
|
@ -410,16 +410,16 @@ static int __devexit mpcore_wdt_remove(struct platform_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int mpcore_wdt_suspend(struct platform_device *dev, pm_message_t msg)
|
static int mpcore_wdt_suspend(struct platform_device *pdev, pm_message_t msg)
|
||||||
{
|
{
|
||||||
struct mpcore_wdt *wdt = platform_get_drvdata(dev);
|
struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
|
||||||
mpcore_wdt_stop(wdt); /* Turn the WDT off */
|
mpcore_wdt_stop(wdt); /* Turn the WDT off */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mpcore_wdt_resume(struct platform_device *dev)
|
static int mpcore_wdt_resume(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mpcore_wdt *wdt = platform_get_drvdata(dev);
|
struct mpcore_wdt *wdt = platform_get_drvdata(pdev);
|
||||||
/* re-activate timer */
|
/* re-activate timer */
|
||||||
if (test_bit(0, &wdt->timer_alive))
|
if (test_bit(0, &wdt->timer_alive))
|
||||||
mpcore_wdt_start(wdt);
|
mpcore_wdt_start(wdt);
|
||||||
|
|
Loading…
Reference in a new issue