From: Ryan Wilson Date: Wed, 22 Mar 2006 21:26:25 +0000 (-0500) Subject: [PATCH] driver core: driver_bind attribute returns incorrect value X-Git-Tag: v2.6.17-rc2~33^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=372254018eb1b65ee69210d11686bfc65c8d84db;p=pandora-kernel.git [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 Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed