public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] 2 small Driver core fixes for 2.6.12-git
@ 2005-06-23  6:09 Greg KH
  2005-06-23  6:10 ` [PATCH] USB: fix hid core to return proper error code from probe Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2005-06-23  6:09 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, stelian, linux-usb-devel

Here's two patches that fixes some oopses with the USB code due to a
change in the driver core (could also cause problems with other
subsystems, just happened to notice it in the USB code.)  Many thanks to
Stelian Pop for noticing this and figuring out the fix for it.

Please pull from:
	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

thanks,

greg k-h

 drivers/base/bus.c           |    5 ++---
 drivers/usb/input/hid-core.c |    4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

------

Greg Kroah-Hartman:
  driver core: Fix up the device_attach() error handling in bus_add_device()

Stelian Pop:
  USB: fix hid core to return proper error code from probe


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

* [PATCH] USB: fix hid core to return proper error code from probe
  2005-06-23  6:09 [GIT PATCH] 2 small Driver core fixes for 2.6.12-git Greg KH
@ 2005-06-23  6:10 ` Greg KH
  2005-06-23  6:10   ` [PATCH] driver core: Fix up the device_attach() error handling in bus_add_device() Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2005-06-23  6:10 UTC (permalink / raw)
  To: linux-kernel, linux-usb-devel; +Cc: stelian

[PATCH] USB: fix hid core to return proper error code from probe

Drivers need to return -ENODEV when they can't bind to a device.
Anything else stops the "bind a device to a driver" search.

From: Stelian Pop <stelian@popies.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 479f6ea85e513551510ad52f37e69e1c596ad356
tree 60eadfd85297f42be75be8863cacbc0ea9d82f3b
parent b7c84c6ada2be942eca6722edb2cfaad412cd5de
author Stelian Pop <stelian@popies.net> Wed, 22 Jun 2005 17:53:28 +0200
committer Greg Kroah-Hartman <gregkh@suse.de> Wed, 22 Jun 2005 23:01:09 -0700

 drivers/usb/input/hid-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1762,7 +1762,7 @@ static int hid_probe(struct usb_interfac
 			intf->altsetting->desc.bInterfaceNumber);
 
 	if (!(hid = usb_hid_configure(intf)))
-		return -EIO;
+		return -ENODEV;
 
 	hid_init_reports(hid);
 	hid_dump_device(hid);
@@ -1777,7 +1777,7 @@ static int hid_probe(struct usb_interfac
 	if (!hid->claimed) {
 		printk ("HID device not claimed by input or hiddev\n");
 		hid_disconnect(intf);
-		return -EIO;
+		return -ENODEV;
 	}
 
 	printk(KERN_INFO);


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

* [PATCH] driver core: Fix up the device_attach() error handling in bus_add_device()
  2005-06-23  6:10 ` [PATCH] USB: fix hid core to return proper error code from probe Greg KH
@ 2005-06-23  6:10   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2005-06-23  6:10 UTC (permalink / raw)
  To: linux-kernel, linux-usb-devel; +Cc: gregkh

[PATCH] driver core: Fix up the device_attach() error handling in bus_add_device()

Don't error out if something "bad" happens when trying to bind a driver to a
device.  We want the sysfs attributes to be present for later when we try to
tear down the device.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit d377e85b537a5e166272f937da6ba84350676b6e
tree f3e5f347cbaa72a1479d991f7cab83228dd44bf0
parent 479f6ea85e513551510ad52f37e69e1c596ad356
author Greg Kroah-Hartman <gregkh@suse.de> Wed, 22 Jun 2005 16:09:05 -0700
committer Greg Kroah-Hartman <gregkh@suse.de> Wed, 22 Jun 2005 23:01:10 -0700

 drivers/base/bus.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -270,10 +270,9 @@ int bus_add_device(struct device * dev)
 
 	if (bus) {
 		pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id);
-		error = device_attach(dev);
+		device_attach(dev);
 		klist_add_tail(&bus->klist_devices, &dev->knode_bus);
-		if (error >= 0)
-			error = device_add_attrs(bus, dev);
+		error = device_add_attrs(bus, dev);
 		if (!error) {
 			sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id);
 			sysfs_create_link(&dev->kobj, &dev->bus->subsys.kset.kobj, "bus");


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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-23  6:09 [GIT PATCH] 2 small Driver core fixes for 2.6.12-git Greg KH
2005-06-23  6:10 ` [PATCH] USB: fix hid core to return proper error code from probe Greg KH
2005-06-23  6:10   ` [PATCH] driver core: Fix up the device_attach() error handling in bus_add_device() Greg KH

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