Re: [PATCH 1/3] iio: accel: bmc150: use aligned scan buffer for both trigger and fifo
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
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