diff options
Diffstat (limited to 'drivers/watchdog/moxart_wdt.c')
-rw-r--r-- | drivers/watchdog/moxart_wdt.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/watchdog/moxart_wdt.c b/drivers/watchdog/moxart_wdt.c index 430c3ab84c07..6340a1f5f471 100644 --- a/drivers/watchdog/moxart_wdt.c +++ b/drivers/watchdog/moxart_wdt.c @@ -91,8 +91,6 @@ static int moxart_wdt_probe(struct platform_device *pdev) { struct moxart_wdt_dev *moxart_wdt; struct device *dev = &pdev->dev; - struct device_node *node = dev->of_node; - struct resource *res; struct clk *clk; int err; unsigned int max_timeout; @@ -104,12 +102,11 @@ static int moxart_wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, moxart_wdt); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - moxart_wdt->base = devm_ioremap_resource(dev, res); + moxart_wdt->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(moxart_wdt->base)) return PTR_ERR(moxart_wdt->base); - clk = of_clk_get(node, 0); + clk = devm_clk_get(dev, NULL); if (IS_ERR(clk)) { pr_err("%s: of_clk_get failed\n", __func__); return PTR_ERR(clk); @@ -136,7 +133,8 @@ static int moxart_wdt_probe(struct platform_device *pdev) watchdog_set_drvdata(&moxart_wdt->dev, moxart_wdt); - err = watchdog_register_device(&moxart_wdt->dev); + watchdog_stop_on_unregister(&moxart_wdt->dev); + err = devm_watchdog_register_device(dev, &moxart_wdt->dev); if (err) return err; @@ -146,15 +144,6 @@ static int moxart_wdt_probe(struct platform_device *pdev) return 0; } -static int moxart_wdt_remove(struct platform_device *pdev) -{ - struct moxart_wdt_dev *moxart_wdt = platform_get_drvdata(pdev); - - moxart_wdt_stop(&moxart_wdt->dev); - - return 0; -} - static const struct of_device_id moxart_watchdog_match[] = { { .compatible = "moxa,moxart-watchdog" }, { }, @@ -163,7 +152,6 @@ MODULE_DEVICE_TABLE(of, moxart_watchdog_match); static struct platform_driver moxart_wdt_driver = { .probe = moxart_wdt_probe, - .remove = moxart_wdt_remove, .driver = { .name = "moxart-watchdog", .of_match_table = moxart_watchdog_match, |