public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* driver_attach question
@ 2005-12-14  2:07 Anil kumar
  2005-12-14  7:23 ` Adam Belay
  0 siblings, 1 reply; 2+ messages in thread
From: Anil kumar @ 2005-12-14  2:07 UTC (permalink / raw)
  To: linux-kernel

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 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-14  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-14  2:07 driver_attach question Anil kumar
2005-12-14  7:23 ` Adam Belay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox