From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Sebastien Bouchard <sebastien.bouchard@ca.kontron.com>, akpm@osdl.org
Subject: [PATCH] tlclk: fix platform_device_register_simple() error check
Date: Thu, 23 Nov 2006 03:41:11 +0900 [thread overview]
Message-ID: <20061122184111.GC2985@APFDCB5C> (raw)
The return value of platform_device_register_simple() should be
checked by IS_ERR().
This patch also fix misc_register() error case. Because misc_register()
returns error code.
Cc: Sebastien Bouchard <sebastien.bouchard@ca.kontron.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
drivers/char/tlclk.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: work-fault-inject/drivers/char/tlclk.c
===================================================================
--- work-fault-inject.orig/drivers/char/tlclk.c
+++ work-fault-inject/drivers/char/tlclk.c
@@ -792,15 +792,14 @@ static int __init tlclk_init(void)
ret = misc_register(&tlclk_miscdev);
if (ret < 0) {
printk(KERN_ERR "tlclk: misc_register returns %d.\n", ret);
- ret = -EBUSY;
goto out3;
}
tlclk_device = platform_device_register_simple("telco_clock",
-1, NULL, 0);
- if (!tlclk_device) {
+ if (IS_ERR(tlclk_device)) {
printk(KERN_ERR "tlclk: platform_device_register failed.\n");
- ret = -EBUSY;
+ ret = PTR_ERR(tlclk_device);
goto out4;
}
next reply other threads:[~2006-11-22 18:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-22 18:41 Akinobu Mita [this message]
2006-11-27 20:34 ` [PATCH] tlclk: fix platform_device_register_simple() error check Mark Gross
2006-11-27 20:46 ` Mark Gross
2006-11-28 6:08 ` Akinobu Mita
2006-11-29 21:17 ` Mark Gross
2006-12-02 4:03 ` Akinobu Mita
2006-12-05 18:25 ` Mark Gross
2007-01-03 16:56 ` Mark Gross
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=20061122184111.GC2985@APFDCB5C \
--to=akinobu.mita@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastien.bouchard@ca.kontron.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox