[PATCH v2] usb: dwc3: Fix renaming SPL_USB_HOST_SUPPORT to SPL_USB_HOST

Oleksandr Suvorov cryosay at gmail.com
Fri Aug 25 12:46:29 CEST 2023


On Fri, Aug 25, 2023 at 1:39 PM Marek Vasut <marex at denx.de> wrote:
>
> On 8/25/23 12:27, Oleksandr Suvorov wrote:
> > On Wed, Aug 23, 2023 at 9:29 PM Marek Vasut <marex at denx.de> wrote:
> >>
> >> On 8/23/23 20:21, Oleksandr Suvorov wrote:
> >>> In the usb/dwc3-layerscape driver the first option should be renamed
> >>> to the latter as well. Do it.
> >>>
> >>> Fixes: 333e4a621df ("Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOST")
> >>> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov at foundries.io>
> >>> ---
> >>>
> >>> Changes in v2:
> >>> - [asked by Tom Rini] shrink the code using CONFIG_IS_ENABLED()
> >>>
> >>>    drivers/usb/dwc3/dwc3-layerscape.c | 5 ++---
> >>>    1 file changed, 2 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/usb/dwc3/dwc3-layerscape.c b/drivers/usb/dwc3/dwc3-layerscape.c
> >>> index 79cf71f7a85..58baa017ad1 100644
> >>> --- a/drivers/usb/dwc3/dwc3-layerscape.c
> >>> +++ b/drivers/usb/dwc3/dwc3-layerscape.c
> >>> @@ -134,8 +134,7 @@ U_BOOT_DRIVER(dwc3_layerscape_peripheral) = {
> >>>    };
> >>>    #endif
> >>>
> >>> -#if defined(CONFIG_SPL_USB_HOST_SUPPORT) || \
> >>> -     !defined(CONFIG_SPL_BUILD) && defined(CONFIG_USB_HOST)
> >>> +#if CONFIG_IS_ENABLED(USB_HOST)
> >>>    static int dwc3_layerscape_host_probe(struct udevice *dev)
> >>>    {
> >>>        struct xhci_hcor *hcor;
> >>> @@ -194,7 +193,7 @@ static int dwc3_layerscape_bind(struct udevice *dev)
> >>>                driver = "dwc3-layerscape-peripheral";
> >>>                break;
> >>>    #endif
> >>> -#if defined(CONFIG_SPL_USB_HOST_SUPPORT) || !defined(CONFIG_SPL_BUILD)
> >>> +#if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
> >>
> >> Why not CONFIG_IS_ENABLED(USB_HOST) here too ?
> >
> > The original logic is not equivalent to CONFIG_IS_ENABLED(USB_HOST),
> > so IMHO it would be better to fix it in a separate commit.
>
> What's the difference ?

The original logic in this function always enables USB_DR_MODE_HOST
switch case if we build u-boot, not SPL.
I've already fixed it in a separate commit. Please review v3.

-- 
Best regards
Oleksandr

Oleksandr Suvorov
cryosay at gmail.com


More information about the U-Boot mailing list