public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Belay <ambx1@neo.rr.com>
To: Anil kumar <anils_r@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: driver_attach question
Date: Wed, 14 Dec 2005 02:23:29 -0500	[thread overview]
Message-ID: <20051214072329.GA4639@neo.rr.com> (raw)
In-Reply-To: <20051214020754.66330.qmail@web32409.mail.mud.yahoo.com>

On Tue, Dec 13, 2005 at 06:07:54PM -0800, Anil kumar wrote:
> 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?

The basic strategy is to leave the driver loaded so that
later, if the a device is hotplugged or the user adds a
dynamic id to an existing device, it will be available.
In other words, even if the registration of a driver does
not result in device detection, the operation can still
considered successful.

Does this answer your question?

Thanks,
Adam

      reply	other threads:[~2005-12-14  6:20 UTC|newest]

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

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=20051214072329.GA4639@neo.rr.com \
    --to=ambx1@neo.rr.com \
    --cc=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