aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2015-12-30 15:13:41 -0800
committerTodd Poynor <toddpoynor@google.com>2015-12-30 15:24:03 -0800
commit25b4eaed8abee8c8919e6c09d71a6dd94e8c2b3c (patch)
treebefda76f36128fcffca98f15c49f9884c412217f
parentb91bdde5037071a502082607fafde238c53693a1 (diff)
downloadqcom-msm-v3.10-25b4eaed8abee8c8919e6c09d71a6dd94e8c2b3c.tar.gz
BRILLO: usb: gadget: fs: Fix and cleanup error messages
Driver got in a state where it prints messages of form: More data(-75) recieved than intended length(7) Print the message before setting the same ret variable to -EOVERFLOW, in order to print the proper number of bytes received. Also fix typos. These messages are codeaurora extensions to the driver, introduced in commit 2e020cf3c8af0d0ccaae60c25c07a72b747cb837, and are not upstream. Bug: None Change-Id: Id3c1217215d60d0b4035b41177182cd53779b404
-rw-r--r--drivers/usb/gadget/f_fs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 6a5fb202cbe..85b96da059a 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -922,12 +922,12 @@ first_try:
spin_unlock_irq(&epfile->ffs->eps_lock);
if (read && ret > 0) {
if (len != MAX_BUF_LEN && ret < len)
- pr_err("less data(%zd) recieved than intended length(%zu)\n",
+ pr_err("less data(%zd) received than intended length(%zu)\n",
ret, len);
if (ret > len) {
- ret = -EOVERFLOW;
- pr_err("More data(%zd) recieved than intended length(%zu)\n",
+ pr_err("More data(%zd) received than intended length(%zu)\n",
ret, len);
+ ret = -EOVERFLOW;
} else if (unlikely(copy_to_user(
buf, data, ret))) {
pr_err("Fail to copy to user len:%zd\n",