diff mbox series

[2/2] drm/stm: ltdc: return appropriate error code during probe

Message ID 1556114601-30936-3-git-send-email-fabien.dessenne@st.com (mailing list archive)
State New, archived
Headers show
Series drm/stm: ltdc: manage error cases in probe | expand

Commit Message

Fabien DESSENNE April 24, 2019, 2:03 p.m. UTC
During probe, return the "clk_get" error value instead of -ENODEV.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/gpu/drm/stm/ltdc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Philippe CORNU April 26, 2019, 12:30 p.m. UTC | #1
Hi Fabien,
and thank you for your patch,

Acked-by: Philippe Cornu <philippe.cornu@st.com>

Philippe :-)

On 4/24/19 4:03 PM, Fabien Dessenne wrote:
> During probe, return the "clk_get" error value instead of -ENODEV.
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> ---
>   drivers/gpu/drm/stm/ltdc.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 521ba83..97912e2 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -1145,8 +1145,9 @@ int ltdc_load(struct drm_device *ddev)
>   
>   	ldev->pixel_clk = devm_clk_get(dev, "lcd");
>   	if (IS_ERR(ldev->pixel_clk)) {
> -		DRM_ERROR("Unable to get lcd clock\n");
> -		return -ENODEV;
> +		if (PTR_ERR(ldev->pixel_clk) != -EPROBE_DEFER)
> +			DRM_ERROR("Unable to get lcd clock\n");
> +		return PTR_ERR(ldev->pixel_clk);
>   	}
>   
>   	if (clk_prepare_enable(ldev->pixel_clk)) {
>
Benjamin Gaignard May 6, 2019, 7:25 a.m. UTC | #2
Le ven. 26 avr. 2019 à 14:30, Philippe CORNU <philippe.cornu@st.com> a écrit :
>
> Hi Fabien,
> and thank you for your patch,
>
> Acked-by: Philippe Cornu <philippe.cornu@st.com>
>
> Philippe :-)
>
> On 4/24/19 4:03 PM, Fabien Dessenne wrote:
> > During probe, return the "clk_get" error value instead of -ENODEV.
> >
> > Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>

Applied on drm-misc-next.
Thanks,
Benjamin

> > ---
> >   drivers/gpu/drm/stm/ltdc.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> > index 521ba83..97912e2 100644
> > --- a/drivers/gpu/drm/stm/ltdc.c
> > +++ b/drivers/gpu/drm/stm/ltdc.c
> > @@ -1145,8 +1145,9 @@ int ltdc_load(struct drm_device *ddev)
> >
> >       ldev->pixel_clk = devm_clk_get(dev, "lcd");
> >       if (IS_ERR(ldev->pixel_clk)) {
> > -             DRM_ERROR("Unable to get lcd clock\n");
> > -             return -ENODEV;
> > +             if (PTR_ERR(ldev->pixel_clk) != -EPROBE_DEFER)
> > +                     DRM_ERROR("Unable to get lcd clock\n");
> > +             return PTR_ERR(ldev->pixel_clk);
> >       }
> >
> >       if (clk_prepare_enable(ldev->pixel_clk)) {
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 521ba83..97912e2 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1145,8 +1145,9 @@  int ltdc_load(struct drm_device *ddev)
 
 	ldev->pixel_clk = devm_clk_get(dev, "lcd");
 	if (IS_ERR(ldev->pixel_clk)) {
-		DRM_ERROR("Unable to get lcd clock\n");
-		return -ENODEV;
+		if (PTR_ERR(ldev->pixel_clk) != -EPROBE_DEFER)
+			DRM_ERROR("Unable to get lcd clock\n");
+		return PTR_ERR(ldev->pixel_clk);
 	}
 
 	if (clk_prepare_enable(ldev->pixel_clk)) {