linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Sean Nyekjaer <sean@geanix.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Nuno Sá" <Nuno.Sa@analog.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	devicetree <devicetree@vger.kernel.org>
Subject: Re: [PATCH v4 5/6] iio: accel: fxls8962af: add hw buffered sampling
Date: Fri, 30 Apr 2021 12:10:38 +0300	[thread overview]
Message-ID: <CAHp75Vcutrga_WQGpYAfB4DcdMmDfpPNmaGDwvOFUCQM-2+oKw@mail.gmail.com> (raw)
In-Reply-To: <20210429122806.3814330-5-sean@geanix.com>

On Thu, Apr 29, 2021 at 3:28 PM Sean Nyekjaer <sean@geanix.com> wrote:
>
> When buffered sampling is enabled, the accelerometer will dump data into
> the internal fifo and interrupt at watermark. Then the driver flushes
> all data to the iio buffer.
> As the accelerometer doesn't have internal timestamps, they are approximated
> between the current and last interrupt.

...

> +       int ret = 0;

Redundant assignment.

> +       fxls8962af_standby(data);
> +
> +       /* Disable buffer interrupt*/
> +       ret = regmap_update_bits(data->regmap, FXLS8962AF_INT_EN,
> +                       FXLS8962AF_INT_EN_BUF_EN, 0);
> +       if (ret < 0)
> +               return ret;

...

> +       if (reg & FXLS8962AF_BUF_STATUS_BUF_OVF) {
> +               dev_err(dev, "Buffer overflown");

overflow

> +               return -1;

Proper error code, please.

> +       }

...

> +       count = reg & FXLS8962AF_BUF_STATUS_BUF_CNT;

> +

Redundant blank line.

> +       if (!count)
> +               return 0;

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-04-30  9:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 12:28 [PATCH v4 1/6] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers Sean Nyekjaer
2021-04-29 12:28 ` [PATCH v4 2/6] dt-bindings: iio: accel: fxls8962af: add bindings Sean Nyekjaer
2021-04-29 15:25   ` Rob Herring
2021-04-29 12:28 ` [PATCH v4 3/6] iio: accel: fxls8962af: add set/get of samplerate Sean Nyekjaer
2021-04-29 12:28 ` [PATCH v4 4/6] iio: accel: fxls8962af: add interrupt support Sean Nyekjaer
2021-04-30  9:02   ` Andy Shevchenko
2021-05-03 11:19     ` Sean Nyekjaer
2021-04-29 12:28 ` [PATCH v4 5/6] iio: accel: fxls8962af: add hw buffered sampling Sean Nyekjaer
2021-04-30  9:10   ` Andy Shevchenko [this message]
2021-04-29 12:28 ` [PATCH v4 6/6] iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads Sean Nyekjaer
2021-04-30  9:14   ` Andy Shevchenko
2021-04-30  9:25 ` [PATCH v4 1/6] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers Tomas Melin
2021-05-02 17:46   ` Jonathan Cameron

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=CAHp75Vcutrga_WQGpYAfB4DcdMmDfpPNmaGDwvOFUCQM-2+oKw@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=Nuno.Sa@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sean@geanix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).