LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: wm8996: match wait_for_completion_timeout return type
@ 2015-03-08 10:02 Nicholas Mc Guire
  2015-03-09 14:26 ` Charles Keepax
  2015-03-09 18:16 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-03-08 10:02 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: Mark Brown, Jaroslav Kysela, Takashi Iwai, Lars-Peter Clausen,
	Charles Keepax, Tomi Valkeinen, Xiubo Li, Sachin Kamat, Axel Lin,
	abdoulaye berthe, patches, alsa-devel, linux-kernel,
	Nicholas Mc Guire

return type of wait_for_completion_timeout is unsigned long not int. An
appropriately named unsigned long is added and the assignment fixed up
in case of completion occurring the remaining time is >=1 so ret is set to
1 if no timeout occurred.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

This was only compile tested for exynos_defconfig + CONFIG_COMPILE_TEST=y, 
SND_SOC_ALL_CODECS=m (implies CONFIG_SND_SOC_WM8996=m)

Patch is against 4.0-rc2 linux-next (localversion-next is -next-20150306)

 sound/soc/codecs/wm8996.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index dc92d5e..24d9705 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2009,7 +2009,7 @@ static int wm8996_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
 	struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
 	struct i2c_client *i2c = to_i2c_client(codec->dev);
 	struct _fll_div fll_div;
-	unsigned long timeout;
+	unsigned long timeout, time_left;
 	int ret, reg, retry;
 
 	/* Any change? */
@@ -2113,10 +2113,11 @@ static int wm8996_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
 		timeout /= 2;
 
 	for (retry = 0; retry < 10; retry++) {
-		ret = wait_for_completion_timeout(&wm8996->fll_lock,
-						  timeout);
-		if (ret != 0) {
+		time_left = wait_for_completion_timeout(&wm8996->fll_lock,
+							timeout);
+		if (time_left != 0) {
 			WARN_ON(!i2c->irq);
+			ret = 1;
 			break;
 		}
 
-- 
1.7.10.4


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

* Re: [PATCH 1/2] ASoC: wm8996: match wait_for_completion_timeout return type
  2015-03-08 10:02 [PATCH 1/2] ASoC: wm8996: match wait_for_completion_timeout return type Nicholas Mc Guire
@ 2015-03-09 14:26 ` Charles Keepax
  2015-03-09 18:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2015-03-09 14:26 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Liam Girdwood, Mark Brown, patches, alsa-devel, linux-kernel

On Sun, Mar 08, 2015 at 06:02:15AM -0400, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. An
> appropriately named unsigned long is added and the assignment fixed up
> in case of completion occurring the remaining time is >=1 so ret is set to
> 1 if no timeout occurred.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Thanks,
Charles

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

* Re: [PATCH 1/2] ASoC: wm8996: match wait_for_completion_timeout return type
  2015-03-08 10:02 [PATCH 1/2] ASoC: wm8996: match wait_for_completion_timeout return type Nicholas Mc Guire
  2015-03-09 14:26 ` Charles Keepax
@ 2015-03-09 18:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-03-09 18:16 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Lars-Peter Clausen,
	Charles Keepax, Tomi Valkeinen, Xiubo Li, Sachin Kamat, Axel Lin,
	abdoulaye berthe, patches, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

On Sun, Mar 08, 2015 at 06:02:15AM -0400, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. An
> appropriately named unsigned long is added and the assignment fixed up
> in case of completion occurring the remaining time is >=1 so ret is set to
> 1 if no timeout occurred.

Applied both, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-03-09 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-08 10:02 [PATCH 1/2] ASoC: wm8996: match wait_for_completion_timeout return type Nicholas Mc Guire
2015-03-09 14:26 ` Charles Keepax
2015-03-09 18:16 ` Mark Brown

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).