提交 9cd44619 编写于 作者: A Akinobu Mita 提交者: Wim Van Sebroeck

[WATCHDOG] fix clk_get() error check

The return value of clk_get() should be checked by IS_ERR().
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 0b6dd8a6
...@@ -283,7 +283,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) ...@@ -283,7 +283,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
wdt_base = (void __iomem *)IO_ADDRESS(res->start); wdt_base = (void __iomem *)IO_ADDRESS(res->start);
wdt_clk = clk_get(&pdev->dev, "wdt_ck"); wdt_clk = clk_get(&pdev->dev, "wdt_ck");
if (!wdt_clk) { if (IS_ERR(wdt_clk)) {
ret = PTR_ERR(wdt_clk);
release_resource(wdt_mem); release_resource(wdt_mem);
kfree(wdt_mem); kfree(wdt_mem);
goto out; goto out;
......
...@@ -393,9 +393,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev) ...@@ -393,9 +393,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
} }
wdt_clock = clk_get(&pdev->dev, "watchdog"); wdt_clock = clk_get(&pdev->dev, "watchdog");
if (wdt_clock == NULL) { if (IS_ERR(wdt_clock)) {
printk(KERN_INFO PFX "failed to find watchdog clock source\n"); printk(KERN_INFO PFX "failed to find watchdog clock source\n");
ret = -ENOENT; ret = PTR_ERR(wdt_clock);
goto err_irq; goto err_irq;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册