Skip to content

Commit 19c70b4

Browse files
Wolfram Sangbroonie
authored andcommitted
ASoC: codecs: wm8994: 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 0800660 commit 19c70b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sound/soc/codecs/wm8994.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ static int _wm8994_set_fll(struct snd_soc_component *component, int id, int src,
22102210
int reg_offset, ret;
22112211
struct fll_div fll;
22122212
u16 reg, clk1, aif_reg, aif_src;
2213-
unsigned long timeout;
2213+
unsigned long time_left;
22142214
bool was_enabled;
22152215
struct clk *mclk;
22162216

@@ -2403,9 +2403,9 @@ static int _wm8994_set_fll(struct snd_soc_component *component, int id, int src,
24032403
WM8994_FLL1_FRAC, reg);
24042404

24052405
if (wm8994->fll_locked_irq) {
2406-
timeout = wait_for_completion_timeout(&wm8994->fll_locked[id],
2407-
msecs_to_jiffies(10));
2408-
if (timeout == 0)
2406+
time_left = wait_for_completion_timeout(&wm8994->fll_locked[id],
2407+
msecs_to_jiffies(10));
2408+
if (time_left == 0)
24092409
dev_warn(component->dev,
24102410
"Timed out waiting for FLL lock\n");
24112411
} else {

0 commit comments

Comments
 (0)