diff options
author | Dan Carpenter <error27@gmail.com> | 2011-06-04 10:10:21 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 20:09:10 +0400 |
commit | e90ed12cc4388d2919823fb31368781baa6dfbe5 (patch) | |
tree | 9249060c51aa045eb4c87c3be41ddbc6a8dcfdb0 /drivers/usb/wusbcore | |
parent | 325fd182cafe5c5ead51c27afb6b8be83c9081d4 (diff) | |
download | linux-e90ed12cc4388d2919823fb31368781baa6dfbe5.tar.xz |
USB: wusbcore: return negative error codes
cbaf_cdid_get() is only used in cbaf_wusb_chid_store().
In the original code cbaf_cdid_get() returns either a negative error
code or a small positive value on error. I have changed it to
return -ENOENT if there is not enough data available.
In the original code the caller changed the negative error codes to
positive return values. I've changed it to just return the error
value directly.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/wusbcore')
-rw-r--r-- | drivers/usb/wusbcore/cbaf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c index c0c5665e60a9..200fd7c6c7d5 100644 --- a/drivers/usb/wusbcore/cbaf.c +++ b/drivers/usb/wusbcore/cbaf.c @@ -298,7 +298,7 @@ static int cbaf_cdid_get(struct cbaf *cbaf) if (result < needed) { dev_err(dev, "Not enough data in DEVICE_INFO reply (%zu vs " "%zu bytes needed)\n", (size_t)result, needed); - return result; + return -ENOENT; } strlcpy(cbaf->device_name, di->DeviceFriendlyName, CBA_NAME_LEN); @@ -350,7 +350,7 @@ static ssize_t cbaf_wusb_chid_store(struct device *dev, return result; result = cbaf_cdid_get(cbaf); if (result < 0) - return -result; + return result; return size; } static DEVICE_ATTR(wusb_chid, 0600, cbaf_wusb_chid_show, cbaf_wusb_chid_store); |