2002-08-17 01:48:13

by harish.vasudeva

[permalink] [raw]
Subject: need help with pci_module_init

hi folks

pci_module_init() works fine only the first time i load my driver. subsequent loads will fail with this call returning -19!! any clues?

thanx
HARISH V



2002-08-17 03:13:48

by Jeff Garzik

[permalink] [raw]
Subject: Re: need help with pci_module_init

[email protected] wrote:> hi folks
>
> pci_module_init() works fine only the first time i load my driver.
> subsequent loads will fail with this call returning -19!! any clues?


It works in the various PCI drivers in drivers/net/* ... I debug
modules all the time by repeatedly loading and unloading them.

Make sure to check that you are using SET_MODULE_OWNER immediately
following your alloc_etherdev() call. It sounds like you might have
messed-up module counts. Also "cat /proc/modules" to check the module
reference count correctness.

Jeff




2002-08-17 03:20:36

by Kai Germaschewski

[permalink] [raw]
Subject: Re: need help with pci_module_init

On Fri, 16 Aug 2002 [email protected] wrote:

> pci_module_init() works fine only the first time i load my driver.
> subsequent loads will fail with this call returning -19!! any clues?

-19 is -ENODEV, i.e. pci_module_init() doesn't find any devices that match
your driver. That's most likely since they're still considered owned by
the previously loaded driver (your module as well), which forgot to
pci_unregister_driver() at unload time.

--Kai