linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.1-pci_register_driver() and counts
@ 2004-01-10 19:53 Jon Smirl
  0 siblings, 0 replies; only message in thread
From: Jon Smirl @ 2004-01-10 19:53 UTC (permalink / raw)
  To: lkml

Is this code in drivers/pci/pci-driver.c, pci_register_driver() correct?

/* register with core */
 count = driver_register(&drv->driver);
if (count >= 0) {
       pci_populate_driver_dir(drv);
}
return count ? count : 1;

Looking at base/driver.c,  driver_register() returns the output from
bus_add_driver().
Looking at base/bus.c, bus_add_driver() does not return a count, it only returns
error codes.

So the code in pci_register_driver() works as long as there is no error and the
return from driver_register() is zero, but it isn't going to work right in the
error case. Also the code is just wrong because it is expecting a count that
isn't returned.

I don't know if the count is needed, but if it is, it looks like driver_attach()
would need to modified to return it instead of void.

=====
Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-10 19:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-10 19:53 2.6.1-pci_register_driver() and counts Jon Smirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).