All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spl: spl_sdp: don't call board_usb_init twice
@ 2022-01-17 14:11 Angus Ainslie
  2022-04-20 18:27 ` Angus Ainslie
  0 siblings, 1 reply; 2+ messages in thread
From: Angus Ainslie @ 2022-01-17 14:11 UTC (permalink / raw)
  To: NXP i.MX U-Boot Team, u-boot; +Cc: kernel, Angus Ainslie

When CONFIG_DM_USB is not defined then usb_gadget_initialize is just a call
to board_usb_init. Calling board_usb_init twice causes the USB to fail so
make sure the second invocation is not compiled in when CONFIG_DM_USB is
not defined.

Signed-off-by: Angus Ainslie <angus@akkea.ca>
---
 common/spl/spl_sdp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
index ae9c09883a..2a2bc8475d 100644
--- a/common/spl/spl_sdp.c
+++ b/common/spl/spl_sdp.c
@@ -17,7 +17,8 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
 	int ret;
 	const int controller_index = CONFIG_SPL_SDP_USB_DEV;
 
-	usb_gadget_initialize(controller_index);
+	if (IS_ENABLED(CONFIG_DM_USB))
+		usb_gadget_initialize(controller_index);
 
 	board_usb_init(0, USB_INIT_DEVICE);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spl: spl_sdp: don't call board_usb_init twice
  2022-01-17 14:11 [PATCH] spl: spl_sdp: don't call board_usb_init twice Angus Ainslie
@ 2022-04-20 18:27 ` Angus Ainslie
  0 siblings, 0 replies; 2+ messages in thread
From: Angus Ainslie @ 2022-04-20 18:27 UTC (permalink / raw)
  To: NXP i.MX U-Boot Team, u-boot; +Cc: kernel

Hi

On 2022-01-17 06:11, Angus Ainslie wrote:
> When CONFIG_DM_USB is not defined then usb_gadget_initialize is just a 
> call
> to board_usb_init. Calling board_usb_init twice causes the USB to fail 
> so
> make sure the second invocation is not compiled in when CONFIG_DM_USB 
> is
> not defined.
> 
> Signed-off-by: Angus Ainslie <angus@akkea.ca>
> ---
>  common/spl/spl_sdp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
> index ae9c09883a..2a2bc8475d 100644
> --- a/common/spl/spl_sdp.c
> +++ b/common/spl/spl_sdp.c
> @@ -17,7 +17,8 @@ static int spl_sdp_load_image(struct spl_image_info
> *spl_image,
>  	int ret;
>  	const int controller_index = CONFIG_SPL_SDP_USB_DEV;
> 
> -	usb_gadget_initialize(controller_index);
> +	if (IS_ENABLED(CONFIG_DM_USB))
> +		usb_gadget_initialize(controller_index);
> 
>  	board_usb_init(0, USB_INIT_DEVICE);

Any comments on this patch ?

Thanks
Angus


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-20 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 14:11 [PATCH] spl: spl_sdp: don't call board_usb_init twice Angus Ainslie
2022-04-20 18:27 ` Angus Ainslie

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.