Skip to content

Commit cebc458

Browse files
Nicholas Mc Guirejic23
authored andcommitted
iio: ad_sigma_delta: use unsigned long for timeout
wait_for_completion_timeout returns unsigned long not int so an appropriate variable is declared and the assignment and check fixed up. Signed-off-by: Nicholas Mc Guire <[email protected]> Reviewed-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 1b3bd85 commit cebc458

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/iio/adc/ad_sigma_delta.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
209209
unsigned int mode, unsigned int channel)
210210
{
211211
int ret;
212+
unsigned long timeout;
212213

213214
ret = ad_sigma_delta_set_channel(sigma_delta, channel);
214215
if (ret)
@@ -224,8 +225,8 @@ static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
224225

225226
sigma_delta->irq_dis = false;
226227
enable_irq(sigma_delta->spi->irq);
227-
ret = wait_for_completion_timeout(&sigma_delta->completion, 2*HZ);
228-
if (ret == 0) {
228+
timeout = wait_for_completion_timeout(&sigma_delta->completion, 2 * HZ);
229+
if (timeout == 0) {
229230
sigma_delta->irq_dis = true;
230231
disable_irq_nosync(sigma_delta->spi->irq);
231232
ret = -EIO;

0 commit comments

Comments
 (0)