media: atmel-isi: 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 <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Wolfram Sang 2024-08-05 23:51:15 +02:00 committed by Hans Verkuil
parent 0016b5a5c7
commit 64979ac2aa

View File

@ -242,7 +242,7 @@ static irqreturn_t isi_interrupt(int irq, void *dev_id)
#define WAIT_ISI_DISABLE 0
static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset)
{
unsigned long timeout;
unsigned long time_left;
/*
* The reset or disable will only succeed if we have a
* pixel clock from the camera.
@ -257,9 +257,9 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset)
isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
}
timeout = wait_for_completion_timeout(&isi->complete,
msecs_to_jiffies(500));
if (timeout == 0)
time_left = wait_for_completion_timeout(&isi->complete,
msecs_to_jiffies(500));
if (time_left == 0)
return -ETIMEDOUT;
return 0;