aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2024-04-29 13:33:06 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-04-29 21:06:18 +0100
commit265b81bb7578d5c30866932cab5acde5a9fa0df0 (patch)
tree8edece49bbee8cc9e6ec3e175b37cd936d77b581
parent860e36b7023580068e1857262a7f25a1836fc30b (diff)
downloadiio-265b81bb7578d5c30866932cab5acde5a9fa0df0.tar.gz
iio: adc: fsl-imx25-gcq: use 'time_left' variable with wait_for_completion_interruptible_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_interruptible_timeout() causing patterns like: timeout = wait_for_completion_interruptible_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 <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20240429113313.68359-4-wsa+renesas@sang-engineering.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/fsl-imx25-gcq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index 394396b916309e..b680690631dbb7 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -108,7 +108,7 @@ static int mx25_gcq_get_raw_value(struct device *dev,
struct mx25_gcq_priv *priv,
int *val)
{
- long timeout;
+ long time_left;
u32 data;
/* Setup the configuration we want to use */
@@ -121,12 +121,12 @@ static int mx25_gcq_get_raw_value(struct device *dev,
regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS,
MX25_ADCQ_CR_FQS);
- timeout = wait_for_completion_interruptible_timeout(
+ time_left = wait_for_completion_interruptible_timeout(
&priv->completed, MX25_GCQ_TIMEOUT);
- if (timeout < 0) {
+ if (time_left < 0) {
dev_err(dev, "ADC wait for measurement failed\n");
- return timeout;
- } else if (timeout == 0) {
+ return time_left;
+ } else if (time_left == 0) {
dev_err(dev, "ADC timed out\n");
return -ETIMEDOUT;
}