mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anil kumar <anils_r@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: driver_attach question
Date: Tue, 13 Dec 2005 18:07:54 -0800 (PST)	[thread overview]
Message-ID: <20051214020754.66330.qmail@web32409.mail.mud.yahoo.com> (raw)

Hi,

Should driver_attach( ) return an error value?

I have disabled a device in the system bios, The
driver fails to report -ENODEV.
This is for 2.6.11.1 kernel
When I dig through the PCI subsystem and driver_attach
code, I find that :

pci_register_driver is returing zero(no error) even
when the device is not present in the system. 
But when I check driver_attach( ), I get -ENODEV for
driver_probe_device(). which is correct. But
driver_attach( ) does not return this error value. 
driver attach( ) is called in bus_add_driver( ) and
bus_add_driver just returns error=0
Hence I get error=0 in pci_register_driver.

Am I missing something in the flow?

int pci_register_driver( )
{
.....
.....
error = driver_register(&drv->driver);
return error;
}

int driver_register(struct device_driver * drv)
{
.....
return bus_add_driver(drv);
}

int bus_add_driver(struct device_driver * drv)
{
.....
driver_attach(drv);
...
return error;
}

void driver_attach(struct device_driver * drv)
{
....
error = driver_probe_device(drv, dev);
....
}

with regards,
  Anil




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

             reply	other threads:[~2005-12-14  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14  2:07 Anil kumar [this message]
2005-12-14  7:23 ` Adam Belay

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=20051214020754.66330.qmail@web32409.mail.mud.yahoo.com \
    --to=anils_r@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®