All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Wim Van Sebroeck <wim@iguana.be>, Ben Dooks <ben@simtec.co.uk>,
	Dimitry Andric <dimitry.andric@tomtom.com>
Subject: [PATCH] watchdog: fix clk_get() error check
Date: Tue, 19 Dec 2006 17:51:44 +0900	[thread overview]
Message-ID: <20061219085144.GI4049@APFDCB5C> (raw)

The return value of clk_get() should be checked by IS_ERR().

Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 drivers/char/watchdog/pnx4008_wdt.c |    3 ++-
 drivers/char/watchdog/s3c2410_wdt.c |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: 2.6-mm/drivers/char/watchdog/pnx4008_wdt.c
===================================================================
--- 2.6-mm.orig/drivers/char/watchdog/pnx4008_wdt.c
+++ 2.6-mm/drivers/char/watchdog/pnx4008_wdt.c
@@ -283,7 +283,8 @@ static int pnx4008_wdt_probe(struct plat
 	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: 2.6-mm/drivers/char/watchdog/s3c2410_wdt.c
===================================================================
--- 2.6-mm.orig/drivers/char/watchdog/s3c2410_wdt.c
+++ 2.6-mm/drivers/char/watchdog/s3c2410_wdt.c
@@ -392,10 +392,10 @@ static int s3c2410wdt_probe(struct platf
 	}
 
 	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");
 		iounmap(wdt_base);
-		return -ENOENT;
+		return PTR_ERR(wdt_clock);
 	}
 
 	clk_enable(wdt_clock);

             reply	other threads:[~2006-12-19  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-19  8:51 Akinobu Mita [this message]
2006-12-19 10:43 ` [PATCH] watchdog: fix clk_get() error check Ben Dooks
2006-12-19 21:22   ` Wim Van Sebroeck
2006-12-19 21:20 ` Wim Van Sebroeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061219085144.GI4049@APFDCB5C \
    --to=akinobu.mita@gmail.com \
    --cc=ben@simtec.co.uk \
    --cc=dimitry.andric@tomtom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.