Re: [PATCH 01/03] MFD: add ADC support to DA9052/53 MFD core v2

From: Arnd Bergmann
Date: Fri Mar 02 2012 - 09:59:41 EST


On Friday 02 March 2012, Ashish Jangam wrote:
> +
> + mutex_lock(&da9052->auxadc_lock);
> +
> + /* Channel gets activated on enabling the Conversion bit */
> + mux_sel = chan_mux[channel] | DA9052_ADC_MAN_MAN_CONV;
> +
> + ret = da9052_reg_write(da9052, DA9052_ADC_MAN_REG, mux_sel);
> + if (ret < 0)
> + goto err;
> +
> + /* Wait for an interrupt */
> + wait_for_completion_timeout(&da9052->done, msecs_to_jiffies(500));

Shouldn't this check the return value of wait_for_completion_timeout
and return an error if it timed out?

If you don't expect a timeout to ever happen, it's probably better to
use wait_for_completion instead of wait_for_completion_timeout, but
if it can time out, you should handle it.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/