* [U-Boot] [PATCH v2] cmd: dfu: Add error handling for board_usb_init
@ 2016-08-30 13:32 Michal Simek
2016-08-30 14:18 ` Lukasz Majewski
2016-08-31 4:30 ` Heiko Schocher
0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2016-08-30 13:32 UTC (permalink / raw)
To: u-boot
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) {
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] cmd: dfu: Add error handling for board_usb_init
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
2016-08-31 4:30 ` Heiko Schocher
1 sibling, 0 replies; 3+ messages in thread
From: Lukasz Majewski @ 2016-08-30 14:18 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] cmd: dfu: Add error handling for board_usb_init
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
@ 2016-08-31 4:30 ` Heiko Schocher
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Schocher @ 2016-08-31 4:30 UTC (permalink / raw)
To: u-boot
Hello Michal,
Am 30.08.2016 um 15:32 schrieb Michal Simek:
> 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(-)
Reviewed-by: Heiko Schocher<hs@denx.de>
bye,
Heiko
>
> 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) {
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-31 4:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2016-08-31 4:30 ` Heiko Schocher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.