u8 csr;
pm_runtime_get_sync(wdt->dev);
+ clk_enable(wdt->clk);
spin_lock_irqsave(&wdt->lock, flags);
spin_unlock_irqrestore(&wdt->lock, flags);
+ clk_disable(wdt->clk);
pm_runtime_put_sync(wdt->dev);
return 0;
wdt->clk = NULL;
}
- clk_enable(wdt->clk);
-
wdt->base = devm_request_and_ioremap(wdt->dev, res);
if (unlikely(!wdt->base)) {
rc = -EADDRNOTAVAIL;
- goto out_disable;
+ goto err;
}
watchdog_set_nowayout(&sh_wdt_dev, nowayout);
rc = watchdog_register_device(&sh_wdt_dev);
if (unlikely(rc)) {
dev_err(&pdev->dev, "Can't register watchdog (err=%d)\n", rc);
- goto out_disable;
+ goto err;
}
init_timer(&wdt->timer);
return 0;
-out_disable:
- clk_disable(wdt->clk);
+err:
clk_put(wdt->clk);
return rc;
watchdog_unregister_device(&sh_wdt_dev);
pm_runtime_disable(&pdev->dev);
- clk_disable(wdt->clk);
clk_put(wdt->clk);
return 0;