Commit 289b0e41 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] cpqarray: check pci_register_driver() return value

From: <mikem@beardog.cca.cpqcorp.net>

* Examines rc of pci_register_driver and returns
parent 13034f82
...@@ -318,9 +318,7 @@ MODULE_PARM(eisa, "1-8i"); ...@@ -318,9 +318,7 @@ MODULE_PARM(eisa, "1-8i");
*/ */
int __init cpqarray_init(void) int __init cpqarray_init(void)
{ {
if(cpqarray_init_step2() == 0) /* all the block dev num already used */ return (cpqarray_init_step2());
return -ENODEV; /* or no controllers were found */
return 0;
} }
static void release_io_mem(ctlr_info_t *c) static void release_io_mem(ctlr_info_t *c)
...@@ -559,18 +557,21 @@ static struct pci_driver cpqarray_pci_driver = { ...@@ -559,18 +557,21 @@ static struct pci_driver cpqarray_pci_driver = {
}; };
/* /*
* This is it. Find all the controllers and register them. I really hate * This is it. Find all the controllers and register them.
* stealing all these major device numbers.
* returns the number of block devices registered. * returns the number of block devices registered.
*/ */
int __init cpqarray_init_step2(void) int __init cpqarray_init_step2(void)
{ {
int num_cntlrs_reg = 0; int num_cntlrs_reg = 0;
int i; int i;
int rc = 0;
/* detect controllers */ /* detect controllers */
printk(DRIVER_NAME "\n"); printk(DRIVER_NAME "\n");
pci_register_driver(&cpqarray_pci_driver); /* TODO: If it's an eisa only system, will rc return negative? */
rc = pci_register_driver(&cpqarray_pci_driver);
if (rc < 0)
return rc;
cpqarray_eisa_detect(); cpqarray_eisa_detect();
for (i=0; i < MAX_CTLR; i++) { for (i=0; i < MAX_CTLR; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment