cmd: dfu: Add error handling for board_usb_init
PATCH v2 1/1 cmd: dfu: Add error handling for board_usb_init
board_usb_init() can failed and error should be handled properly.
Signed-off-by Michal Simek <[email protected]>
---
Changes in v2:
- Fix type in return error value
common/dfu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
common/dfu.c +5 -1
@@ -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) {
Signature · 1 line
1.9.1
PATCH v2 1/1 cmd: dfu: Add error handling for board_usb_init
Hi Michal,
Quoted 18 lines
board_usb_init()can failed and error should be handled properly.Signed-off-by Michal Simek <[email protected]>---
Changes in v2:
- Fix type in return error valuecommon/dfu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)common/dfu.c +0
-0@@ -24,7 +24,11 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget) bool dfu_reset = false;int ret, i =0 ;
common/dfu.c int run_usb_dnl_gadget(int usbctrl_index, char · line 34
Quoted 10 lines
common/dfu.c +5
-1-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 <[email protected]>
Thanks for the patch.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH v2 1/1 cmd: dfu: Add error handling for board_usb_init
In reply to Michal SimekHello Michal,
Am 30.08.2016 um 15:32 schrieb Michal Simek:
Quoted 10 lines
board_usb_init()can failed and error should be handled properly.Signed-off-by Michal Simek <[email protected]>---
Changes in v2:
- Fix type in return error valuecommon/dfu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by Heiko Schocher<[email protected]>
bye,
Heiko
Quoted 19 lines
common/dfu.c +5
-1@@ -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) {
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany