diff options
Diffstat (limited to 'drivers/usb/wusbcore')
-rw-r--r-- | drivers/usb/wusbcore/cbaf.c | 4 | ||||
-rw-r--r-- | drivers/usb/wusbcore/wa-xfer.c | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c index c0c5665e60a..200fd7c6c7d 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); diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c index 6ccd93a9b90..419334568be 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c @@ -83,6 +83,7 @@ #include <linux/spinlock.h> #include <linux/slab.h> #include <linux/hash.h> +#include <linux/ratelimit.h> #include "wa-hc.h" #include "wusbhc.h" @@ -1217,16 +1218,14 @@ static int wa_xfer_status_to_errno(u8 status) if (status == 0) return 0; if (status >= ARRAY_SIZE(xlat)) { - if (printk_ratelimit()) - printk(KERN_ERR "%s(): BUG? " + printk_ratelimited(KERN_ERR "%s(): BUG? " "Unknown WA transfer status 0x%02x\n", __func__, real_status); return -EINVAL; } errno = xlat[status]; if (unlikely(errno > 0)) { - if (printk_ratelimit()) - printk(KERN_ERR "%s(): BUG? " + printk_ratelimited(KERN_ERR "%s(): BUG? " "Inconsistent WA status: 0x%02x\n", __func__, real_status); errno = -errno; |