diff mbox

ASoC: sti: Fix error handling if of_clk_get() fails

Message ID 20170428132210.jvjrltku25sepivw@mwanda (mailing list archive)
State Accepted
Commit 65ed0a8d1f24abd79be149253025de8949321900
Headers show

Commit Message

Dan Carpenter April 28, 2017, 1:22 p.m. UTC
We intended to return here.  The current code has a static checker
warning because we set "ret" but don't use it.

Fixes: 76c2145ded6b ("ASoC: sti: Add CPU DAI driver for playback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Arnaud POULIQUEN April 28, 2017, 1:45 p.m. UTC | #1
Hi Dan,

Acked-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>

Thanks!

Arnaud

On 04/28/2017 03:22 PM, Dan Carpenter wrote:
> We intended to return here.  The current code has a static checker
> warning because we set "ret" but don't use it.
> 
> Fixes: 76c2145ded6b ("ASoC: sti: Add CPU DAI driver for playback")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c
> index d7e8dd46d2cc..d8b6936e544e 100644
> --- a/sound/soc/sti/uniperif_player.c
> +++ b/sound/soc/sti/uniperif_player.c
> @@ -1074,7 +1074,7 @@ int uni_player_init(struct platform_device *pdev,
>  	player->clk = of_clk_get(pdev->dev.of_node, 0);
>  	if (IS_ERR(player->clk)) {
>  		dev_err(player->dev, "Failed to get clock\n");
> -		ret = PTR_ERR(player->clk);
> +		return PTR_ERR(player->clk);
>  	}
>  
>  	/* Select the frequency synthesizer clock */
>
diff mbox

Patch

diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c
index d7e8dd46d2cc..d8b6936e544e 100644
--- a/sound/soc/sti/uniperif_player.c
+++ b/sound/soc/sti/uniperif_player.c
@@ -1074,7 +1074,7 @@  int uni_player_init(struct platform_device *pdev,
 	player->clk = of_clk_get(pdev->dev.of_node, 0);
 	if (IS_ERR(player->clk)) {
 		dev_err(player->dev, "Failed to get clock\n");
-		ret = PTR_ERR(player->clk);
+		return PTR_ERR(player->clk);
 	}
 
 	/* Select the frequency synthesizer clock */