[U-Boot,1/1] dwc3-generic: Don't fail probe if clk/reset entries are absent
diff mbox series

Message ID 20191025081805.5289-1-vigneshr@ti.com
State Accepted
Commit d624434f5ebc5e3eb5f5609f06200f477cf8d8b5
Delegated to: Marek Vasut
Headers show
Series
  • [U-Boot,1/1] dwc3-generic: Don't fail probe if clk/reset entries are absent
Related show

Commit Message

Vignesh Raghavendra Oct. 25, 2019, 8:18 a.m. UTC
Some boards don't populate clk/reset entries as these are are optional
as per binding documentation. Therefore, don't fail driver probe if
clk/reset entries are absent in DT.

This fixes fastboot failures seen due to enabling of CONFIG_CLK on AM57xx

Fixes: e8e683d33b0c ("board: ti: am57xx-idk: Configure the CDCE913 clock synthesizer")
Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/usb/dwc3/dwc3-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tero Kristo Oct. 25, 2019, 8:20 a.m. UTC | #1
On 25/10/2019 11:18, Vignesh Raghavendra wrote:
> Some boards don't populate clk/reset entries as these are are optional
> as per binding documentation. Therefore, don't fail driver probe if
> clk/reset entries are absent in DT.
> 
> This fixes fastboot failures seen due to enabling of CONFIG_CLK on AM57xx
> 
> Fixes: e8e683d33b0c ("board: ti: am57xx-idk: Configure the CDCE913 clock synthesizer")
> Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>

Thanks for the patch.

Tested-by: Tero Kristo <t-kristo@ti.com>

> ---
>   drivers/usb/dwc3/dwc3-generic.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index 406bf0b3628b..d76cd7a4c5ca 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -258,7 +258,7 @@ static int dwc3_glue_reset_init(struct udevice *dev,
>   	int ret;
>   
>   	ret = reset_get_bulk(dev, &glue->resets);
> -	if (ret == -ENOTSUPP)
> +	if (ret == -ENOTSUPP || ret == -ENOENT)
>   		return 0;
>   	else if (ret)
>   		return ret;
> @@ -278,7 +278,7 @@ static int dwc3_glue_clk_init(struct udevice *dev,
>   	int ret;
>   
>   	ret = clk_get_bulk(dev, &glue->clks);
> -	if (ret == -ENOSYS)
> +	if (ret == -ENOSYS || ret == -ENOENT)
>   		return 0;
>   	if (ret)
>   		return ret;
> 

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Sam Protsenko Oct. 25, 2019, 10:08 a.m. UTC | #2
Hi Vignesh,

On Fri, Oct 25, 2019 at 11:17 AM Vignesh Raghavendra <vigneshr@ti.com> wrote:
>
> Some boards don't populate clk/reset entries as these are are optional
> as per binding documentation. Therefore, don't fail driver probe if
> clk/reset entries are absent in DT.
>
> This fixes fastboot failures seen due to enabling of CONFIG_CLK on AM57xx
>
> Fixes: e8e683d33b0c ("board: ti: am57xx-idk: Configure the CDCE913 clock synthesizer")
> Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---

Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>

>  drivers/usb/dwc3/dwc3-generic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index 406bf0b3628b..d76cd7a4c5ca 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -258,7 +258,7 @@ static int dwc3_glue_reset_init(struct udevice *dev,
>         int ret;
>
>         ret = reset_get_bulk(dev, &glue->resets);
> -       if (ret == -ENOTSUPP)
> +       if (ret == -ENOTSUPP || ret == -ENOENT)
>                 return 0;
>         else if (ret)
>                 return ret;
> @@ -278,7 +278,7 @@ static int dwc3_glue_clk_init(struct udevice *dev,
>         int ret;
>
>         ret = clk_get_bulk(dev, &glue->clks);
> -       if (ret == -ENOSYS)
> +       if (ret == -ENOSYS || ret == -ENOENT)
>                 return 0;
>         if (ret)
>                 return ret;
> --
> 2.23.0
>
Sam Protsenko Oct. 25, 2019, 10:08 a.m. UTC | #3
+ Praneeth

On Fri, Oct 25, 2019 at 1:08 PM Sam Protsenko
<semen.protsenko@linaro.org> wrote:
>
> Hi Vignesh,
>
> On Fri, Oct 25, 2019 at 11:17 AM Vignesh Raghavendra <vigneshr@ti.com> wrote:
> >
> > Some boards don't populate clk/reset entries as these are are optional
> > as per binding documentation. Therefore, don't fail driver probe if
> > clk/reset entries are absent in DT.
> >
> > This fixes fastboot failures seen due to enabling of CONFIG_CLK on AM57xx
> >
> > Fixes: e8e683d33b0c ("board: ti: am57xx-idk: Configure the CDCE913 clock synthesizer")
> > Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
> > Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> > ---
>
> Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
>
> >  drivers/usb/dwc3/dwc3-generic.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> > index 406bf0b3628b..d76cd7a4c5ca 100644
> > --- a/drivers/usb/dwc3/dwc3-generic.c
> > +++ b/drivers/usb/dwc3/dwc3-generic.c
> > @@ -258,7 +258,7 @@ static int dwc3_glue_reset_init(struct udevice *dev,
> >         int ret;
> >
> >         ret = reset_get_bulk(dev, &glue->resets);
> > -       if (ret == -ENOTSUPP)
> > +       if (ret == -ENOTSUPP || ret == -ENOENT)
> >                 return 0;
> >         else if (ret)
> >                 return ret;
> > @@ -278,7 +278,7 @@ static int dwc3_glue_clk_init(struct udevice *dev,
> >         int ret;
> >
> >         ret = clk_get_bulk(dev, &glue->clks);
> > -       if (ret == -ENOSYS)
> > +       if (ret == -ENOSYS || ret == -ENOENT)
> >                 return 0;
> >         if (ret)
> >                 return ret;
> > --
> > 2.23.0
> >
Marek Vasut Oct. 25, 2019, 1:50 p.m. UTC | #4
On 10/25/19 10:18 AM, Vignesh Raghavendra wrote:
> Some boards don't populate clk/reset entries as these are are optional
> as per binding documentation. Therefore, don't fail driver probe if
> clk/reset entries are absent in DT.
> 
> This fixes fastboot failures seen due to enabling of CONFIG_CLK on AM57xx

Applied, thanks.

Patch
diff mbox series

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 406bf0b3628b..d76cd7a4c5ca 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -258,7 +258,7 @@  static int dwc3_glue_reset_init(struct udevice *dev,
 	int ret;
 
 	ret = reset_get_bulk(dev, &glue->resets);
-	if (ret == -ENOTSUPP)
+	if (ret == -ENOTSUPP || ret == -ENOENT)
 		return 0;
 	else if (ret)
 		return ret;
@@ -278,7 +278,7 @@  static int dwc3_glue_clk_init(struct udevice *dev,
 	int ret;
 
 	ret = clk_get_bulk(dev, &glue->clks);
-	if (ret == -ENOSYS)
+	if (ret == -ENOSYS || ret == -ENOENT)
 		return 0;
 	if (ret)
 		return ret;