commit 5e66b0b5f187c811419ff10cfb5668c028a64d57
tree ae387b8f938272ad6fbee48b5794644c9da2e14c
parent 753ca4f312a4b26940e4731b4fa5dbbbbcc77e97
author Akinobu Mita <[EMAIL PROTECTED]> 1164481775 -0800
committer Linus Torvalds <[EMAIL PROTECTED]> 1164490114 -0800

[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 <[EMAIL PROTECTED]>
Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/char/tlclk.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index 2444a0e..244d30a 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;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to