All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ashish Jangam <ashish.jangam@kpitcummins.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linux-kernel@vger.kernel.org, Dajun <dajun.chen@diasemi.com>,
	sameo@linux.intel.com
Subject: Re: [PATCH 01/03] MFD: add ADC support to DA9052/53 MFD  core v2
Date: Fri, 2 Mar 2012 14:59:34 +0000	[thread overview]
Message-ID: <201203021459.36840.arnd@arndb.de> (raw)
In-Reply-To: <1330698533.21817.30.camel@dhruva>

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

  reply	other threads:[~2012-03-02 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 14:28 [PATCH 01/03] MFD: add ADC support to DA9052/53 MFD core v2 Ashish Jangam
2012-03-02 14:59 ` Arnd Bergmann [this message]
2012-03-16 16:29 ` Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201203021459.36840.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dajun.chen@diasemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.