kernel-hacking-2024-linux-s.../drivers/base
Ryan Wilson 372254018e [PATCH] driver core: driver_bind attribute returns incorrect value
The manual driver <-> device binding attribute in sysfs doesn't return
the correct value on failure or success of driver_probe_device.
driver_probe_device returns 1 on success (the driver accepted the
device) or 0 on probe failure (when the driver didn't accept the
device but no real error occured). However, the attribute can't just
return 0 or 1, it must return the number of bytes consumed from buf
or an error value. Returning 0 indicates to userspace that nothing
was written (even though the kernel has tried to do the bind/probe and
failed). Returning 1 indicates that only one character was accepted in
which case userspace will re-try the write with a partial string.

A more correct version of driver_bind would return count (to indicate
the entire string was consumed) when driver_probe_device returns 1
and -ENODEV when driver_probe_device returns 0. This patch makes that
change.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:41:25 -07:00
..
power [PATCH] swsusp: add check for suspension of X-controlled devices 2006-03-23 07:38:08 -08:00
attribute_container.c [PATCH] drivers/base - fix sparse warnings 2005-10-28 09:52:55 -07:00
base.h [PATCH] drivers/base/: proper prototypes 2006-02-06 12:17:17 -08:00
bus.c [PATCH] driver core: driver_bind attribute returns incorrect value 2006-04-14 11:41:25 -07:00
class.c [PATCH] driver core: fix unnecessary NULL check in drivers/base/class.c 2006-04-14 11:41:24 -07:00
core.c [PATCH] DocBook: fix kernel-doc comments 2006-01-10 08:01:53 -08:00
cpu.c [PATCH] Check if cpu can be onlined before calling smp_prepare_cpu() 2006-03-25 08:23:01 -08:00
dd.c [PATCH] driver core: safely unbind drivers for devices not on a bus 2006-04-14 11:41:24 -07:00
dmapool.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
driver.c [PATCH] Add bus_type probe, remove, shutdown methods. 2006-01-13 11:26:04 -08:00
firmware.c [PATCH] drivers/base - fix sparse warnings 2005-10-28 09:52:55 -07:00
firmware_class.c [PATCH] firmware: fix BUG: in fw_realloc_buffer 2006-03-20 13:42:58 -08:00
init.c [PATCH] memory hotplug: sysfs and add/remove functions 2005-10-29 21:40:44 -07:00
Kconfig [PATCH] driver core: replace "hotplug" by "uevent" 2006-01-04 16:18:08 -08:00
Makefile [PATCH] Export cpu topology in sysfs 2006-02-03 08:32:09 -08:00
map.c [PATCH] kobj_map semaphore to mutex conversion 2006-03-20 13:42:58 -08:00
memory.c [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00
node.c [PATCH] Fix NULL pointer dereference in node_read_numastat() 2006-04-11 06:18:30 -07:00
platform.c Fix "frist", "fisrt", typos 2006-03-22 00:21:33 +01:00
sys.c [PATCH] drivers/base/: proper prototypes 2006-02-06 12:17:17 -08:00
topology.c [PATCH] Export cpu topology in sysfs 2006-02-03 08:32:09 -08:00
transport_class.c