Skip to content

Commit cfcd957

Browse files
Wolfram Sangbroonie
authored andcommitted
ASoC: codecs: wm8962: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent ba2a2c3 commit cfcd957

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sound/soc/codecs/wm8962.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s
28862886
{
28872887
struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component);
28882888
struct _fll_div fll_div;
2889-
unsigned long timeout;
2889+
unsigned long time_left;
28902890
int ret;
28912891
int fll1 = 0;
28922892

@@ -2974,14 +2974,14 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s
29742974
* higher if we'll error out
29752975
*/
29762976
if (wm8962->irq)
2977-
timeout = msecs_to_jiffies(5);
2977+
time_left = msecs_to_jiffies(5);
29782978
else
2979-
timeout = msecs_to_jiffies(1);
2979+
time_left = msecs_to_jiffies(1);
29802980

2981-
timeout = wait_for_completion_timeout(&wm8962->fll_lock,
2982-
timeout);
2981+
time_left = wait_for_completion_timeout(&wm8962->fll_lock,
2982+
time_left);
29832983

2984-
if (timeout == 0 && wm8962->irq) {
2984+
if (time_left == 0 && wm8962->irq) {
29852985
dev_err(component->dev, "FLL lock timed out");
29862986
snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1,
29872987
WM8962_FLL_ENA, 0);

0 commit comments

Comments
 (0)