2 small Driver core fixes for 2.6.12-git
Subsystems (2)
PATCH 1/1 2 small Driver core fixes for 2.6.12-git
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
PATCH 1/1 USB: fix hid core to return proper error code from probe
[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 <[email protected]>
---
commit 479f6ea85e513551510ad52f37e69e1c596ad356
tree 60eadfd85297f42be75be8863cacbc0ea9d82f3b
parent b7c84c6ada2be942eca6722edb2cfaad412cd5de
author Stelian Pop <[email protected]> Wed, 22 Jun 2005 17:53:28 +0200 committer Greg Kroah-Hartman <[email protected]> Wed, 22 Jun 2005 23:01:09 -0700
drivers/usb/input/hid-core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/input/hid-core.c +2 -2
@@ -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_interfacif (!hid->claimed) {printk ("HID device not claimed by input or hiddev\n" );hid_disconnect (intf); -return -EIO ; +return -ENODEV ; }printk (KERN_INFO );
PATCH 1/1 driver core: Fix up the device_attach() error handling in bus_add_device()
[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.
---
commit d377e85b537a5e166272f937da6ba84350676b6e
tree f3e5f347cbaa72a1479d991f7cab83228dd44bf0
parent 479f6ea85e513551510ad52f37e69e1c596ad356
author Greg Kroah-Hartman <[email protected]> Wed, 22 Jun 2005 16:09:05 -0700 committer Greg Kroah-Hartman <[email protected]> Wed, 22 Jun 2005 23:01:10 -0700
drivers/base/bus.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/base/bus.c +2 -3
@@ -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" );