Re: [PATCH 1/3] iio: accel: bmc150: use aligned scan buffer for both trigger and fifo

From: Andy Shevchenko

Date: Sat Aug 15 2026 - 04:53:54 EST


On Fri, Aug 14, 2026 at 03:48:42PM +0530, Yash Suthar wrote:
> Drop buffer as duplicate and s16 is not correct we needed __le16 as little
> endian, keep scan at the end of the bmc150_accel_data struct with
> IIO_DMA_MINALIGN, and use it for both paths.

...

> mutex_lock(&data->mutex);
> ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_REG_XOUT_L,
> - data->buffer, AXIS_MAX * 2);
> + data->scan.channels, AXIS_MAX * 2);
> + if (!ret)
> + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
> + pf->timestamp);
> mutex_unlock(&data->mutex);
> - if (ret < 0)
> - goto err_read;
>
> - iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
> - pf->timestamp);
> -err_read:
> iio_trigger_notify_done(indio_dev->trig);

Vast of these lines do not need to be touched. Please, keep the usual pattern
of checking for errors first.

> return IRQ_HANDLED;

--
With Best Regards,
Andy Shevchenko