Re: [PATCH] cpqarray update

From: Jeff Garzik
Date: Mon Jan 26 2004 - 20:53:06 EST


Wiran, Francis wrote:
You need to check the return value of pci_module_init() for errors.

No, because the return value is determined from number of ctrls found,
and not from function return.

int __init cpqarray_init(void)
{
...
pci_module_init(&cpqarray_pci_driver);
cpqarray_eisa_detect();

for(i=0;i<MAX_CTLR;i++) {
if(hba[i] != NULL)
num_ctlrs_reg++
}

return (num_ctlrs_reg);
}

int __init cpqarray_init_module(void)
{
if (cpqarray_init() == 0)
return -ENODEV;
return 0;
}


Nope, this needs to be turned inside out. The proper PCI driver looks like

static int __init cp_init (void)
{
return pci_module_init (&cp_driver);
}

static void __exit cp_exit (void)
{
pci_unregister_driver (&cp_driver);
}

We already handle the cases you describe. The cpqarray code -breaks- the API design by doing it this way.

cpqarray does not fully support the pci_ids features and hotplug without this.

Jeff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/