Re: [PATCH v2 1/3] media: imx-pxp: Check the return value from clk_prepare_enable()

2018-11-06 Thread Philipp Zabel
Hi Fabio,

thank you for the fixes!

On Mon, 2018-11-05 at 18:45 -0200, Fabio Estevam wrote:
> clk_prepare_enable() may fail, so we should better check its return value
> and propagate it in the case of error.
> 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v1:
> - Properly enumerate the series
> 
>  drivers/media/platform/imx-pxp.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/imx-pxp.c 
> b/drivers/media/platform/imx-pxp.c
> index b76cd0e..27780f1 100644
> --- a/drivers/media/platform/imx-pxp.c
> +++ b/drivers/media/platform/imx-pxp.c
> @@ -1666,7 +1666,10 @@ static int pxp_probe(struct platform_device *pdev)
>   return ret;
>   }
>  
> - clk_prepare_enable(dev->clk);
> + ret = clk_prepare_enable(dev->clk);
> + if (ret < 0)
> + return ret;
> +
>   pxp_soft_reset(dev);
>  
>   spin_lock_init(>irqlock);

Reviewed-by: Philipp Zabel 

regards
Philipp


[PATCH v2 1/3] media: imx-pxp: Check the return value from clk_prepare_enable()

2018-11-05 Thread Fabio Estevam
clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Properly enumerate the series

 drivers/media/platform/imx-pxp.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c
index b76cd0e..27780f1 100644
--- a/drivers/media/platform/imx-pxp.c
+++ b/drivers/media/platform/imx-pxp.c
@@ -1666,7 +1666,10 @@ static int pxp_probe(struct platform_device *pdev)
return ret;
}
 
-   clk_prepare_enable(dev->clk);
+   ret = clk_prepare_enable(dev->clk);
+   if (ret < 0)
+   return ret;
+
pxp_soft_reset(dev);
 
spin_lock_init(>irqlock);
-- 
2.7.4