summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-11-25 11:09:35 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-25 13:28:34 -0800
commit5e66b0b5f187c811419ff10cfb5668c028a64d57 (patch)
treeae387b8f938272ad6fbee48b5794644c9da2e14c /drivers
parent753ca4f312a4b26940e4731b4fa5dbbbbcc77e97 (diff)
[PATCH] tlclk: fix platform_device_register_simple() error check
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tlclk.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index 2444a0e24b31..244d30a03fef 100644
--- a/drivers/char/tlclk.c
+++ b/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;
}