From: Hector Palacios <hector.palacios@digi.com>
To: linux-iio@vger.kernel.org
Cc: public-linux-iio-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org,
public-otavio-fKevB0iiKLMBZ+LybsDmbA@plane.gmane.org,
Jonathan Cameron
<public-jic23-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org>,
Fabio Estevam
<public-fabio.estevam-KZfg59tc24xl57MIdRCFDg@plane.gmane.org>
Subject: Re: [PATCH] iio: mxs-lradc: Remove useless check in read_raw
Date: Tue, 02 Jul 2013 11:19:37 +0200 [thread overview]
Message-ID: <51D29B29.8080909@digi.com> (raw)
In-Reply-To: <1372723722-13902-1-git-send-email-marex@denx.de>
Dear Marek,
On 07/02/2013 02:08 AM, Marek Vasut wrote:
> The removed check in the read_raw implementation was always true,
> therefore remove it.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index d92c97a..c318eb6 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -234,7 +234,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> {
> struct mxs_lradc *lradc = iio_priv(iio_dev);
> int ret;
> - unsigned long mask;
>
> if (m != IIO_CHAN_INFO_RAW)
> return -EINVAL;
> @@ -243,12 +242,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> if (chan->channel > LRADC_MAX_TOTAL_CHANS)
> return -EINVAL;
>
> - /* Validate the channel if it doesn't intersect with reserved chans. */
> - bitmap_set(&mask, chan->channel, 1);
> - ret = iio_validate_scan_mask_onehot(iio_dev, &mask);
> - if (ret)
> - return -EINVAL;
> -
> /*
> * See if there is no buffered operation in progess. If there is, simply
> * bail out. This can be improved to support both buffered and raw IO at
>
By "always true" you mean that it always entered the if and exited with -EINVAL, right?
I just started to look at this driver on my MX28 platform and this check was always
returning -EINVAL. With this patch I can now read the channels.
Was this what was happening to you as well?
Thank you,
--
Héctor Palacios
next prev parent reply other threads:[~2013-07-02 9:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 0:08 [PATCH] iio: mxs-lradc: Remove useless check in read_raw Marek Vasut
2013-07-02 3:38 ` Otavio Salvador
2013-07-02 17:58 ` Marek Vasut
2013-07-02 9:19 ` Hector Palacios [this message]
2013-07-02 11:43 ` Alexandre Belloni
2013-07-02 11:53 ` Otavio Salvador
2013-07-02 12:03 ` Marek Vasut
2013-07-02 12:49 ` Alexandre Belloni
2013-07-02 16:13 ` Marek Vasut
2013-07-02 16:37 ` Otavio Salvador
2013-07-02 17:36 ` Marek Vasut
2013-07-02 17:42 ` Otavio Salvador
2013-07-02 17:55 ` Marek Vasut
2013-07-03 9:25 ` Hector Palacios
2013-07-03 11:38 ` Marek Vasut
2013-07-03 13:58 ` Hector Palacios
2013-07-03 19:26 ` Jonathan Cameron
2013-07-02 17:19 ` Alexandre Belloni
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=51D29B29.8080909@digi.com \
--to=hector.palacios@digi.com \
--cc=linux-iio@vger.kernel.org \
--cc=public-fabio.estevam-KZfg59tc24xl57MIdRCFDg@plane.gmane.org \
--cc=public-jic23-DgEjT+Ai2ygdnm+yROfE0A@plane.gmane.org \
--cc=public-linux-iio-u79uwXL29TY76Z2rM5mHXA@plane.gmane.org \
--cc=public-otavio-fKevB0iiKLMBZ+LybsDmbA@plane.gmane.org \
/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.