]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
cpqarry: fix return value of cpqarray_init()
authorAndrey Borzenkov <arvidjaar@mail.ru>
Thu, 6 Nov 2008 20:53:15 +0000 (12:53 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Nov 2008 23:41:17 +0000 (15:41 -0800)
As reported by Dick Gevers on Compaq ProLiant:

Oct 13 18:06:51 dvgcpl kernel: Compaq SMART2 Driver (v 2.6.0)
Oct 13 18:06:51 dvgcpl kernel: sys_init_module: 'cpqarray'->init
suspiciously returned 1, it should follow 0/-E convention
Oct 13 18:06:51 dvgcpl kernel: sys_init_module: loading module anyway...
Oct 13 18:06:51 dvgcpl kernel: Pid: 315, comm: modprobe Not tainted
2.6.27-desktop-0.rc8.2mnb #1
Oct 13 18:06:51 dvgcpl kernel:  [<c0380612>] ? printk+0x18/0x1e
Oct 13 18:06:51 dvgcpl kernel:  [<c0158f85>] sys_init_module+0x155/0x1c0
Oct 13 18:06:51 dvgcpl kernel:  [<c0103f06>] syscall_call+0x7/0xb
Oct 13 18:06:51 dvgcpl kernel:  =======================

Make it return 0 on success and -ENODEV if no array was found.

Reported-by: Dick Gevers <dvgevers@xs4all.nl>
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/cpqarray.c

index 47d233c6d0b33879b83994c8d39757de940e82cd..5d39df14ed9032eef70f62f87ec21427f14ad6a1 100644 (file)
@@ -567,7 +567,12 @@ static int __init cpqarray_init(void)
                        num_cntlrs_reg++;
        }
 
-       return(num_cntlrs_reg);
+       if (num_cntlrs_reg)
+               return 0;
+       else {
+               pci_unregister_driver(&cpqarray_pci_driver);
+               return -ENODEV;
+       }
 }
 
 /* Function to find the first free pointer into our hba[] array */