From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaehoon Chung Date: Mon, 28 Nov 2016 18:45:50 +0900 Subject: [U-Boot] [PATCH] cmd: usb: run 'usb start' when USB is stopped In-Reply-To: <384f905d-ea4c-1b43-04bf-dc40e6a6dcc8@redhat.com> References: <1473416416-4643-1-git-send-email-jh80.chung@samsung.com> <9c898974-68be-2c1b-1060-9f1388d25770@samsung.com> <384f905d-ea4c-1b43-04bf-dc40e6a6dcc8@redhat.com> Message-ID: <27c083d5-03da-7e73-df98-f36567b87d04@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/28/2016 05:11 PM, Hans de Goede wrote: > Hi, > > On 28-11-16 07:54, Minkyu Kang wrote: >> Hi Jaehoon, >> >> On 28/11/16 14:08, Jaehoon Chung wrote: >>> Hi Marek, >>> >>> On 09/23/2016 01:15 PM, Simon Glass wrote: >>>> +Marek >>>> >>>> On 9 September 2016 at 04:20, Jaehoon Chung wrote: >>>>> If USB is stopped, just run 'usb start' instead of printing message. >>>>> Then user didn't consider whether usb is started or stopped. >>> >>> Do you have any other opinion for this? :) >>> >>> Best Regards, >>> Jaehoon Chung >>> >>>>> >>>>> Signed-off-by: Jaehoon Chung >>>>> --- >>>>> cmd/usb.c | 4 ++-- >>>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/cmd/usb.c b/cmd/usb.c >>>>> index 455127c..4970851 100644 >>>>> --- a/cmd/usb.c >>>>> +++ b/cmd/usb.c >>>>> @@ -651,8 +651,8 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) >>>>> return 0; >>>>> } >>>>> if (!usb_started) { >>>>> - printf("USB is stopped. Please issue 'usb start' first.\n"); >>>>> - return 1; >>>>> + printf("USB is stopped. Running 'usb start' first.\n"); >>>>> + do_usb_start(); >>>>> } >> >> It seems to ambiguous whether initialization was succeed or not. > > Right at a minimum it should detect that do_usb_start succeeds. E.g. > on an otg port without an otg -> usb-host cable plugged in it will not > succeed. Got it..Then discard this patch. Thanks for pointing out. Best Regards, Jaehoon Chung > > Regards, > > Hans > > >