lkml.org 
[lkml]   [2004]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpqarray update
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.033 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site