staging: panel: return register value
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 9 Mar 2015 14:38:24 +0000 (20:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2015 13:06:12 +0000 (14:06 +0100)
we were returning success even if the module failed to register.
now we are returning the actual return value, success or error.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/panel/panel.c

index ac147253cc54d5c4c0d2d77905f49cd5426fb20d..ee26413cea4745ff40f3947e9dba891cde9e43f9 100644 (file)
@@ -2282,7 +2282,7 @@ static struct parport_driver panel_driver = {
 /* init function */
 static int __init panel_init_module(void)
 {
-       int selected_keypad_type = NOT_SET;
+       int selected_keypad_type = NOT_SET, err;
 
        /* take care of an eventual profile */
        switch (profile) {
@@ -2388,9 +2388,10 @@ static int __init panel_init_module(void)
                return -ENODEV;
        }
 
-       if (parport_register_driver(&panel_driver)) {
+       err = parport_register_driver(&panel_driver);
+       if (err) {
                pr_err("could not register with parport. Aborting.\n");
-               return -EIO;
+               return err;
        }
 
        if (pprt)