mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Smirl <jonsmirl@yahoo.com>
To: lkml <linux-kernel@vger.kernel.org>
Subject: 2.6.1-pci_register_driver() and counts
Date: Sat, 10 Jan 2004 11:53:48 -0800 (PST)	[thread overview]
Message-ID: <20040110195348.24557.qmail@web14905.mail.yahoo.com> (raw)

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

                 reply	other threads:[~2004-01-10 19:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040110195348.24557.qmail@web14905.mail.yahoo.com \
    --to=jonsmirl@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®