linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable
@ 2017-05-22 10:31 Arvind Yadav
  2017-05-22 10:40 ` Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arvind Yadav @ 2017-05-22 10:31 UTC (permalink / raw)
  To: vireshk, andriy.shevchenko, dan.j.williams, vinod.koul
  Cc: dmaengine, linux-kernel

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/dma/dw/platform.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index c639c60..bc31fe8 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -306,8 +306,12 @@ static int dw_resume_early(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct dw_dma_chip *chip = platform_get_drvdata(pdev);
+	int ret;
+
+	ret = clk_prepare_enable(chip->clk);
+	if (ret)
+		return ret;
 
-	clk_prepare_enable(chip->clk);
 	return dw_dma_enable(chip);
 }
 
-- 
1.9.1

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

* Re: [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable
  2017-05-22 10:31 [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable Arvind Yadav
@ 2017-05-22 10:40 ` Viresh Kumar
  2017-05-22 18:20 ` Andy Shevchenko
  2017-05-24  4:26 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2017-05-22 10:40 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: vireshk, andriy.shevchenko, dan.j.williams, vinod.koul, dmaengine,
	linux-kernel

Create the patch using this command and the unnecessary "v1" in the
subject will go away:

$ git format-patch -C -M --thread=shallow

On 22-05-17, 16:01, Arvind Yadav wrote:
> clk_prepare_enable() can fail here and we must check its return value.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/dma/dw/platform.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> index c639c60..bc31fe8 100644
> --- a/drivers/dma/dw/platform.c
> +++ b/drivers/dma/dw/platform.c
> @@ -306,8 +306,12 @@ static int dw_resume_early(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct dw_dma_chip *chip = platform_get_drvdata(pdev);
> +	int ret;
> +
> +	ret = clk_prepare_enable(chip->clk);
> +	if (ret)
> +		return ret;
>  
> -	clk_prepare_enable(chip->clk);
>  	return dw_dma_enable(chip);
>  }

You don't need to resend it for now.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable
  2017-05-22 10:31 [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable Arvind Yadav
  2017-05-22 10:40 ` Viresh Kumar
@ 2017-05-22 18:20 ` Andy Shevchenko
  2017-05-24  4:26 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-05-22 18:20 UTC (permalink / raw)
  To: Arvind Yadav, vireshk, dan.j.williams, vinod.koul; +Cc: dmaengine, linux-kernel

On Mon, 2017-05-22 at 16:01 +0530, Arvind Yadav wrote:
> clk_prepare_enable() can fail here and we must check its return value.
> 

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/dma/dw/platform.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> index c639c60..bc31fe8 100644
> --- a/drivers/dma/dw/platform.c
> +++ b/drivers/dma/dw/platform.c
> @@ -306,8 +306,12 @@ static int dw_resume_early(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct dw_dma_chip *chip = platform_get_drvdata(pdev);
> +	int ret;
> +
> +	ret = clk_prepare_enable(chip->clk);
> +	if (ret)
> +		return ret;
>  
> -	clk_prepare_enable(chip->clk);
>  	return dw_dma_enable(chip);
>  }
>  

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable
  2017-05-22 10:31 [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable Arvind Yadav
  2017-05-22 10:40 ` Viresh Kumar
  2017-05-22 18:20 ` Andy Shevchenko
@ 2017-05-24  4:26 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2017-05-24  4:26 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: vireshk, andriy.shevchenko, dan.j.williams, dmaengine,
	linux-kernel

On Mon, May 22, 2017 at 04:01:48PM +0530, Arvind Yadav wrote:
> clk_prepare_enable() can fail here and we must check its return value.

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2017-05-24  4:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 10:31 [PATCH v1] dmaengine: DW DMAC: Handle return value of clk_prepare_enable Arvind Yadav
2017-05-22 10:40 ` Viresh Kumar
2017-05-22 18:20 ` Andy Shevchenko
2017-05-24  4:26 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).