[WATCHDOG] fix clk_get() error check
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 19 Dec 2006 08:51:44 +0000 (17:51 +0900)
committerWim Van Sebroeck <wim@iguana.be>
Tue, 19 Dec 2006 21:16:51 +0000 (22:16 +0100)
The return value of clk_get() should be checked by IS_ERR().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/char/watchdog/pnx4008_wdt.c
drivers/char/watchdog/s3c2410_wdt.c

index 3a55fc6abcd8fe3a7382111dbf24493c97a31a4d..0e3d589d6332316b84d57cb80ce7376f787fb0aa 100644 (file)
@@ -283,7 +283,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
        wdt_base = (void __iomem *)IO_ADDRESS(res->start);
 
        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);
                kfree(wdt_mem);
                goto out;
index d3c073787f5b307beb5d0595f9f7e3796393fcfe..5a5cc2a2c5afd770aa088cad2757ef2a6cdfbea6 100644 (file)
@@ -393,9 +393,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
        }
 
        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");
-               ret =  -ENOENT;
+               ret = PTR_ERR(wdt_clock);
                goto err_irq;
        }