diff options
author | Mateusz Zalega <m.zalega@samsung.com> | 2014-04-30 13:07:48 +0200 |
---|---|---|
committer | Lukasz Majewski <l.majewski@samsung.com> | 2014-05-05 08:00:28 +0200 |
commit | 75504e9592745021006cb8905b5ff5a51d9d1cb3 (patch) | |
tree | d3f70f43a6eb464de67b84664d068f819fb01d9a /common | |
parent | 6b423b752b24bf69962821754314418621fc71cc (diff) | |
download | u-boot-imx-75504e9592745021006cb8905b5ff5a51d9d1cb3.zip u-boot-imx-75504e9592745021006cb8905b5ff5a51d9d1cb3.tar.gz u-boot-imx-75504e9592745021006cb8905b5ff5a51d9d1cb3.tar.bz2 |
usb: dfu: fix boards wo USB cable detection
Former usb_cable_connected() patch broke compilation of boards which do
not support this feature.
I've renamed usb_cable_connected() to g_dnl_usb_cable_connected() and added
its default implementation to gadget downloader driver code. There's
only one driver of this kind and it's unlikely there'll be another, so
there's no point in keeping it in /common.
Previously this function was declared in usb.h. I've moved it, since
it's more appropriate to keep it in g_dnl.h - usb.h seems to be intended
for USB host implementation.
Existing code, confronted with default -EOPNOTSUPP return value,
continues as if the cable was connected.
CONFIG_USB_CABLE_CHECK was removed.
Change-Id: Ib9198621adee2811b391c64512f14646cefd0369
Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_usb_mass_storage.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c index 5f557d5..14a5b6a 100644 --- a/common/cmd_usb_mass_storage.c +++ b/common/cmd_usb_mass_storage.c @@ -45,10 +45,14 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, /* Timeout unit: seconds */ int cable_ready_timeout = UMS_CABLE_READY_TIMEOUT; - if (!usb_cable_connected()) { + if (!g_dnl_board_usb_cable_connected()) { + /* + * Won't execute if we don't know whether the cable is + * connected. + */ puts("Please connect USB cable.\n"); - while (!usb_cable_connected()) { + while (!g_dnl_board_usb_cable_connected()) { if (ctrlc()) { puts("\rCTRL+C - Operation aborted.\n"); goto exit; |