public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stelian Pop <stelian@popies.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [linux-usb-devel] Re: usb sysfs intf files no longer created when probe fails
Date: Wed, 22 Jun 2005 17:53:28 +0200	[thread overview]
Message-ID: <1119455608.4651.5.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0506221133230.6938-100000@iolanthe.rowland.org>

Le mercredi 22 juin 2005 à 11:41 -0400, Alan Stern a écrit :

> This is a curious aspect of the driver model core.  Should failure of a 
> driver to bind be considered serious enough to cause device_add to fail?
> The current answer is Yes unless the driver's probe routine returns 
> -ENODEV or -ENXIO, in which case the failure is not considered serious.

Indeed. I've also tracked my problem down to the hid core which returns
-EIO when it fails to drive an unknown HID device, instead of a more
logical -ENODEV (this is not a failure to init a known device, but
rather the impossibility to init an unknown device).

The patch below solves the problem for me:

Index: linux-2.6-trunk.git/drivers/usb/input/hid-core.c
===================================================================
--- linux-2.6-trunk.git.orig/drivers/usb/input/hid-core.c	2005-06-22
10:33:23.000000000 +0200
+++ linux-2.6-trunk.git/drivers/usb/input/hid-core.c	2005-06-22
17:43:10.000000000 +0200
@@ -1784,7 +1784,7 @@
 	if (!hid->claimed) {
 		printk ("HID device not claimed by input or hiddev\n");
 		hid_disconnect(intf);
-		return -EIO;
+		return -ENODEV;
 	}
 
 	printk(KERN_INFO);


> IMO this is a perverse way of doing things.  The existence of a device has 
> nothing to do with what driver is bound to it.  Either the device exists 
> or it doesn't -- and if it exists, failure to bind a driver shouldn't 
> prevent adding the device into sysfs.  Right now, however, it does.

I agree, presence in /sys/devices shouldn't be related to the existence
or success/failure of a driver. The link between /sys/class
towards /sys/devices is already saying this.

Stelian.
-- 
Stelian Pop <stelian@popies.net>


  reply	other threads:[~2005-06-22 15:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 13:50 usb sysfs intf files no longer created when probe fails Stelian Pop
2005-06-22 14:07 ` [linux-usb-devel] " Stelian Pop
2005-06-22 14:56   ` Stelian Pop
2005-06-22 16:03     ` Alan Stern
2005-06-22 18:33       ` Stelian Pop
2005-06-22 16:17     ` Greg KH
2005-06-22 14:59 ` Greg KH
2005-06-22 15:09   ` [linux-usb-devel] " Stelian Pop
2005-06-22 15:41     ` Alan Stern
2005-06-22 15:53       ` Stelian Pop [this message]
2005-06-22 16:22         ` Greg KH
2005-06-22 18:27           ` Stelian Pop
2005-06-22 16:26         ` Greg KH
2005-06-22 18:25           ` Stelian Pop

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=1119455608.4651.5.camel@localhost.localdomain \
    --to=stelian@popies.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=stern@rowland.harvard.edu \
    /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