lkml.org 
[lkml]   [2004]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] 2.6.6 synclinkmp.c
From
Date
On Tue, 2004-06-01 at 15:57, Russell King wrote:
> If pci_register_driver fails, the driver is not, repeat not left
> registered. Therefore it must not be unregistered after failure
> to register.

You are right. The specific problem I was trying to
fix is when no hardware is detected. I looked at other
PCI drivers (char/epca.c and net/eepro100.c) and which call
pci_unregister_driver if pci_register_driver returns <= 0
and indicates that pci_register_device returns the number
of pci devices detected. I now see that the two drivers I
looked at are broken. (bad luck that)

After looking at the source for pci_register_device(),
if no devices are detected, then it still returns 1.

I will rework the patches against synclink.c/synclinkmp.c
to only call pci_unregister_device() if init fails
(such as when no devices are detected)
*and* the call to pci_register_device() succeeds.

--
Paul Fulghum
paulkf@microgate.com


-
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:03    [from the cache]
©2003-2011 Jasper Spaans