diff options
-rw-r--r-- | drivers/watchdog/tegra_wdt.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/watchdog/tegra_wdt.c b/drivers/watchdog/tegra_wdt.c index d11b99816ca6..b46fd206a662 100644 --- a/drivers/watchdog/tegra_wdt.c +++ b/drivers/watchdog/tegra_wdt.c @@ -65,7 +65,7 @@ struct tegra_wdt { bool enabled; }; -static struct tegra_wdt *tegra_wdt_dev; +static struct platform_device *tegra_wdt_dev; static void tegra_wdt_enable(struct tegra_wdt *wdt) { @@ -108,8 +108,7 @@ static int tegra_wdt_notify(struct notifier_block *this, static int tegra_wdt_open(struct inode *inode, struct file *file) { - struct miscdevice *miscdev = file->private_data; - struct tegra_wdt *wdt = dev_get_drvdata(miscdev->parent); + struct tegra_wdt *wdt = platform_get_drvdata(tegra_wdt_dev); if (test_and_set_bit(1, &wdt->users)) return -EBUSY; @@ -277,7 +276,7 @@ static int tegra_wdt_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, wdt); - tegra_wdt_dev = wdt; + tegra_wdt_dev = pdev; #ifdef CONFIG_TEGRA_WATCHDOG_ENABLE_ON_PROBE wdt->enabled = true; wdt->timeout = heartbeat; @@ -313,7 +312,7 @@ static int tegra_wdt_remove(struct platform_device *pdev) release_mem_region(wdt->res_src->start, resource_size(wdt->res_src)); release_mem_region(wdt->res_wdt->start, resource_size(wdt->res_wdt)); kfree(wdt); - tegra_wdt_dev = NULL; + platform_set_drvdata(pdev, NULL); return 0; } |