提交 027d89d9 编写于 作者: V Vladimir Zapolskiy 提交者: Guenter Roeck

watchdog: sa11x0/pxa: fix error path of driver initialization

The change corrects release of captured resources on error path, namely
the clock is disabled and put if misc device registration fails and not
enabled clock is not disabled now.

Fixes: 6924089c ("watchdog: sa11x0/pxa: get rid of get_clock_tick_rate")
Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Acked-by: NRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 f3519a66
......@@ -188,12 +188,14 @@ static int __init sa1100dog_init(void)
pre_margin = oscr_freq * margin;
ret = misc_register(&sa1100dog_miscdev);
if (ret == 0)
if (ret == 0) {
pr_info("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
margin);
return ret;
err:
return 0;
}
clk_disable_unprepare(clk);
err:
clk_put(clk);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册