All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] ASoC: sti: Add CPU DAI driver for playback
@ 2017-04-28 11:28 Dan Carpenter
  2017-04-28 12:02 ` Arnaud Pouliquen
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2017-04-28 11:28 UTC (permalink / raw)
  To: arnaud.pouliquen; +Cc: alsa-devel

Hello Arnaud Pouliquen,

The patch 76c2145ded6b: "ASoC: sti: Add CPU DAI driver for playback"
from Jun 22, 2015, leads to the following static checker warning:

    sound/soc/sti/uniperif_player.c:1077 uni_player_init()
    warn: unused return: ret = PTR_ERR()

sound/soc/sti/uniperif_player.c
  1047  int uni_player_init(struct platform_device *pdev,
  1048                      struct uniperif *player)
  1049  {
  1050          int ret = 0;
  1051  
  1052          player->dev = &pdev->dev;
  1053          player->state = UNIPERIF_STATE_STOPPED;
  1054          player->dai_ops = &uni_player_dai_ops;
  1055  
  1056          /* Get PCM_CLK_SEL & PCMP_VALID_SEL from audio-glue-ctrl SoC reg */
  1057          ret = uni_player_parse_dt_audio_glue(pdev, player);
  1058  
  1059          if (ret < 0) {
  1060                  dev_err(player->dev, "Failed to parse DeviceTree\n");
  1061                  return ret;
  1062          }
  1063  
  1064          /* Underflow recovery is only supported on later ip revisions */
  1065          if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
  1066                  player->underflow_enabled = 1;
  1067  
  1068          if (UNIPERIF_TYPE_IS_TDM(player))
  1069                  player->hw = &uni_tdm_hw;
  1070          else
  1071                  player->hw = &uni_player_pcm_hw;
  1072  
  1073          /* Get uniperif resource */
  1074          player->clk = of_clk_get(pdev->dev.of_node, 0);
  1075          if (IS_ERR(player->clk)) {
  1076                  dev_err(player->dev, "Failed to get clock\n");
  1077                  ret = PTR_ERR(player->clk);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
This should probably be "return PTR_ERR(player->clk);?  Can we run
without a clk?

  1078          }
  1079  
  1080          /* Select the frequency synthesizer clock */
  1081          if (player->clk_sel) {
  1082                  ret = regmap_field_write(player->clk_sel, 1);
  1083                  if (ret) {
  1084                          dev_err(player->dev,
  1085                                  "%s: Failed to select freq synth clock\n",
  1086                                  __func__);
  1087                          return ret;
  1088                  }
  1089          }

regards,
dan carpenter

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

* Re: [bug report] ASoC: sti: Add CPU DAI driver for playback
  2017-04-28 11:28 [bug report] ASoC: sti: Add CPU DAI driver for playback Dan Carpenter
@ 2017-04-28 12:02 ` Arnaud Pouliquen
  2017-04-28 13:22     ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaud Pouliquen @ 2017-04-28 12:02 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: alsa-devel

Hi Dan,

On 04/28/2017 01:28 PM, Dan Carpenter wrote:
> Hello Arnaud Pouliquen,
> 
> The patch 76c2145ded6b: "ASoC: sti: Add CPU DAI driver for playback"
> from Jun 22, 2015, leads to the following static checker warning:
> 
>     sound/soc/sti/uniperif_player.c:1077 uni_player_init()
>     warn: unused return: ret = PTR_ERR()
> 
> sound/soc/sti/uniperif_player.c
>   1047  int uni_player_init(struct platform_device *pdev,
>   1048                      struct uniperif *player)
>   1049  {
>   1050          int ret = 0;
>   1051  
>   1052          player->dev = &pdev->dev;
>   1053          player->state = UNIPERIF_STATE_STOPPED;
>   1054          player->dai_ops = &uni_player_dai_ops;
>   1055  
>   1056          /* Get PCM_CLK_SEL & PCMP_VALID_SEL from audio-glue-ctrl SoC reg */
>   1057          ret = uni_player_parse_dt_audio_glue(pdev, player);
>   1058  
>   1059          if (ret < 0) {
>   1060                  dev_err(player->dev, "Failed to parse DeviceTree\n");
>   1061                  return ret;
>   1062          }
>   1063  
>   1064          /* Underflow recovery is only supported on later ip revisions */
>   1065          if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
>   1066                  player->underflow_enabled = 1;
>   1067  
>   1068          if (UNIPERIF_TYPE_IS_TDM(player))
>   1069                  player->hw = &uni_tdm_hw;
>   1070          else
>   1071                  player->hw = &uni_player_pcm_hw;
>   1072  
>   1073          /* Get uniperif resource */
>   1074          player->clk = of_clk_get(pdev->dev.of_node, 0);
>   1075          if (IS_ERR(player->clk)) {
>   1076                  dev_err(player->dev, "Failed to get clock\n");
>   1077                  ret = PTR_ERR(player->clk);
>                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
> This should probably be "return PTR_ERR(player->clk);?  Can we run
> without a clk?
Yes you are right, thanks for highlighting the issue. the clock is
mandatory.

Don't hesitate to propose the patch, i will ack it. Or tell me if you
prefer that i fix it on my side...

Regards
Arnaud

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

* [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails
  2017-04-28 12:02 ` Arnaud Pouliquen
@ 2017-04-28 13:22     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-04-28 13:22 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: alsa-devel, kernel-janitors, Arnaud Pouliquen, Takashi Iwai,
	Mark Brown, Wei Yongjun

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 */

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

* [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails
@ 2017-04-28 13:22     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-04-28 13:22 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: alsa-devel, kernel-janitors, Arnaud Pouliquen, Takashi Iwai,
	Mark Brown, Wei Yongjun

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 */

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

* Re: [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails
  2017-04-28 13:22     ` Dan Carpenter
@ 2017-04-28 13:45       ` Arnaud Pouliquen
  -1 siblings, 0 replies; 8+ messages in thread
From: Arnaud Pouliquen @ 2017-04-28 13:45 UTC (permalink / raw)
  To: Dan Carpenter, Liam Girdwood
  Cc: alsa-devel, kernel-janitors, Takashi Iwai, Mark Brown, Wei Yongjun

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 */
> 

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

* Re: [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails
@ 2017-04-28 13:45       ` Arnaud Pouliquen
  0 siblings, 0 replies; 8+ messages in thread
From: Arnaud Pouliquen @ 2017-04-28 13:45 UTC (permalink / raw)
  To: Dan Carpenter, Liam Girdwood
  Cc: alsa-devel, kernel-janitors, Takashi Iwai, Mark Brown, Wei Yongjun

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 */
> 

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

* Applied "ASoC: sti: Fix error handling if of_clk_get() fails" to the asoc tree
  2017-04-28 13:22     ` Dan Carpenter
@ 2017-04-30 12:58       ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-04-30 12:58 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Arnaud POULIQUEN, Mark Brown, Liam Girdwood

The patch

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

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 65ed0a8d1f24abd79be149253025de8949321900 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 28 Apr 2017 16:22:10 +0300
Subject: [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails

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>
Acked-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sti/uniperif_player.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.11.0


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

* Applied "ASoC: sti: Fix error handling if of_clk_get() fails" to the asoc tree
@ 2017-04-30 12:58       ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-04-30 12:58 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Arnaud POULIQUEN, Mark Brown, Liam Girdwood

The patch

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

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 65ed0a8d1f24abd79be149253025de8949321900 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 28 Apr 2017 16:22:10 +0300
Subject: [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails

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>
Acked-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sti/uniperif_player.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.11.0


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

end of thread, other threads:[~2017-04-30 12:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 11:28 [bug report] ASoC: sti: Add CPU DAI driver for playback Dan Carpenter
2017-04-28 12:02 ` Arnaud Pouliquen
2017-04-28 13:22   ` [PATCH] ASoC: sti: Fix error handling if of_clk_get() fails Dan Carpenter
2017-04-28 13:22     ` Dan Carpenter
2017-04-28 13:45     ` Arnaud Pouliquen
2017-04-28 13:45       ` Arnaud Pouliquen
2017-04-30 12:58     ` Applied "ASoC: sti: Fix error handling if of_clk_get() fails" to the asoc tree Mark Brown
2017-04-30 12:58       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.