commit 6897083abfb0156b533ab8ac42c47f68c550ca9e
tree 511eb7ea465123ddac43bbfe1ef8e0ecb721a7f9
parent 55aa601e14cbec987fa577a895e9297df1d0a71d
author Akinobu Mita <[EMAIL PROTECTED]> 1163668765 -0800
committer Linus Torvalds <[EMAIL PROTECTED]> 1163706218 -0800

[PATCH] dell_rbu: fix error check

platform_device_register_simple() returns error code as pointer when it
fails.  The return value should be checked by IS_ERR().

Cc: Abhay Salunke <[EMAIL PROTECTED]>
Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
Cc: Matt Domsch <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/firmware/dell_rbu.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 08b1617..fc702e4 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -705,17 +705,16 @@ static struct bin_attribute rbu_packet_s
 
 static int __init dcdrbu_init(void)
 {
-       int rc = 0;
+       int rc;
        spin_lock_init(&rbu_data.lock);
 
        init_packet_head();
-       rbu_device =
-               platform_device_register_simple("dell_rbu", -1, NULL, 0);
-       if (!rbu_device) {
+       rbu_device = platform_device_register_simple("dell_rbu", -1, NULL, 0);
+       if (IS_ERR(rbu_device)) {
                printk(KERN_ERR
                        "dell_rbu:%s:platform_device_register_simple "
                        "failed\n", __FUNCTION__);
-               return -EIO;
+               return PTR_ERR(rbu_device);
        }
 
        rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
-
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