public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Steve Rae <srae@broadcom.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 3/5] usb/gadget: fastboot: minor cleanup
Date: Wed, 6 Aug 2014 16:55:11 -0700	[thread overview]
Message-ID: <1407369313-13815-4-git-send-email-srae@broadcom.com> (raw)
In-Reply-To: <1407369313-13815-1-git-send-email-srae@broadcom.com>

- update static function
- additional debugging statements
- update "fastboot command" information
- add missing include file
- update spelling

Signed-off-by: Steve Rae <srae@broadcom.com>
---

Changes in v4:
- update debug string as per feedback

Changes in v3: None
Changes in v2:
- new in v2

 common/cmd_fastboot.c           |  7 ++++---
 drivers/usb/gadget/f_fastboot.c | 13 +++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index 83fa7bd..909616d 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -30,7 +30,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 }
 
 U_BOOT_CMD(
-	fastboot,	1,	1,	do_fastboot,
-	"fastboot - enter USB Fastboot protocol",
-	""
+	fastboot,	1,	0,	do_fastboot,
+	"use USB Fastboot protocol",
+	"\n"
+	"    - run as a fastboot usb device"
 );
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index e2659fa..3b588a9 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -10,6 +10,7 @@
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
+#include <config.h>
 #include <common.h>
 #include <errno.h>
 #include <malloc.h>
@@ -41,7 +42,7 @@
 struct f_fastboot {
 	struct usb_function usb_function;
 
-	/* IN/OUT EP's and correspoinding requests */
+	/* IN/OUT EP's and corresponding requests */
 	struct usb_ep *in_ep, *out_ep;
 	struct usb_request *in_req, *out_req;
 };
@@ -293,7 +294,7 @@ static int fastboot_add(struct usb_configuration *c)
 }
 DECLARE_GADGET_BIND_CALLBACK(usb_dnl_fastboot, fastboot_add);
 
-int fastboot_tx_write(const char *buffer, unsigned int buffer_size)
+static int fastboot_tx_write(const char *buffer, unsigned int buffer_size)
 {
 	struct usb_request *in_req = fastboot_func->in_req;
 	int ret;
@@ -341,6 +342,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
 
 	strsep(&cmd, ":");
 	if (!cmd) {
+		printf("%s: missing variable\n", __func__);
 		fastboot_tx_write_str("FAILmissing var");
 		return;
 	}
@@ -361,6 +363,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
 		else
 			strcpy(response, "FAILValue not set");
 	} else {
+		printf("%s: unknown variable: %s\n", __func__, cmd);
 		strcpy(response, "FAILVariable not implemented");
 	}
 	fastboot_tx_write_str(response);
@@ -534,10 +537,12 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
 		}
 	}
 
-	if (!func_cb)
+	if (!func_cb) {
+		printf("%s: unknown command: %s\n", __func__, cmdbuf);
 		fastboot_tx_write_str("FAILunknown command");
-	else
+	} else {
 		func_cb(ep, req);
+	}
 
 	if (req->status == 0) {
 		*cmdbuf = '\0';
-- 
1.8.5

  parent reply	other threads:[~2014-08-06 23:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 23:55 [U-Boot] [PATCH v4 0/5] Implement "fastboot flash" for eMMC Steve Rae
2014-08-06 23:55 ` [U-Boot] [PATCH v4 1/5] usb/gadget: fastboot: add eMMC support for flash command Steve Rae
2014-08-06 23:55 ` [U-Boot] [PATCH v4 2/5] usb/gadget: fastboot: add " Steve Rae
2014-08-06 23:55 ` Steve Rae [this message]
2014-08-06 23:55 ` [U-Boot] [PATCH v4 4/5] usb/gadget: fastboot: add sparse image definitions Steve Rae
2014-08-07  0:14   ` Marek Vasut
2014-08-07  0:31     ` Steve Rae
2014-08-07  0:37       ` Marek Vasut
2014-08-07  5:36     ` Wolfgang Denk
2014-08-07 13:11       ` Marek Vasut
2014-08-07  5:34   ` Wolfgang Denk
2014-08-07 13:09     ` Marek Vasut
2014-08-07 13:29       ` Sebastian Andrzej Siewior
2014-08-07 13:45         ` Marek Vasut
2014-08-07 13:51           ` Sebastian Andrzej Siewior
2014-08-07 14:12             ` Marek Vasut
2014-08-07 16:40             ` Steve Rae
2014-08-07 20:59         ` Wolfgang Denk
2014-08-07 21:02           ` Jeroen Hofstee
2014-08-07 21:10             ` Wolfgang Denk
2014-08-07 21:15               ` Jeroen Hofstee
2014-08-07 21:19                 ` Jeroen Hofstee
2014-08-07 21:36                 ` Wolfgang Denk
2014-08-07 21:43                   ` Marek Vasut
2014-08-07 22:17                     ` Wolfgang Denk
2014-08-09 12:48                       ` Marek Vasut
2014-08-09 16:53                         ` Steve Rae
2014-08-10 20:42                           ` Marek Vasut
2014-08-07 21:49                 ` Marek Vasut
2014-08-06 23:55 ` [U-Boot] [PATCH v4 5/5] usb/gadget: fastboot: implement sparse format Steve Rae
2014-08-07  0:16 ` [U-Boot] [PATCH v4 0/5] Implement "fastboot flash" for eMMC Marek Vasut
2014-08-07  0:29   ` Steve Rae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407369313-13815-4-git-send-email-srae@broadcom.com \
    --to=srae@broadcom.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox