public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] cmd: dfu: Add error handling for board_usb_init
Date: Tue, 30 Aug 2016 16:18:06 +0200	[thread overview]
Message-ID: <20160830161806.6c143ca2@amdc2363> (raw)
In-Reply-To: <68d18850f13cda008b0fd31c521c9682bab664e2.1472563934.git.michal.simek@xilinx.com>

Hi Michal,

> board_usb_init() can failed and error should be handled properly.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Changes in v2:
> - Fix type in return error value
> 
>  common/dfu.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/common/dfu.c b/common/dfu.c
> index 4c529f7c36f9..0e9f5f59c80a 100644
> --- a/common/dfu.c
> +++ b/common/dfu.c
> @@ -24,7 +24,11 @@ int run_usb_dnl_gadget(int usbctrl_index, char
> *usb_dnl_gadget) bool dfu_reset = false;
>  	int ret, i = 0;
>  
> -	board_usb_init(usbctrl_index, USB_INIT_DEVICE);
> +	ret = board_usb_init(usbctrl_index, USB_INIT_DEVICE);
> +	if (ret) {
> +		error("board usb init failed\n");
> +		return CMD_RET_FAILURE;
> +	}
>  	g_dnl_clear_detach();
>  	ret = g_dnl_register(usb_dnl_gadget);
>  	if (ret) {

Acked-by: Lukasz Majewski <l.majewski@samsung.com>

Thanks for the patch.

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

  reply	other threads:[~2016-08-30 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 13:32 [U-Boot] [PATCH v2] cmd: dfu: Add error handling for board_usb_init Michal Simek
2016-08-30 14:18 ` Lukasz Majewski [this message]
2016-08-31  4:30 ` Heiko Schocher

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=20160830161806.6c143ca2@amdc2363 \
    --to=l.majewski@samsung.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