Re: [PATCH v4 5/6] iio: accel: fxls8962af: add hw buffered sampling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 29, 2021 at 3:28 PM Sean Nyekjaer <sean@xxxxxxxxxx> 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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux