> -----Original Message-----
> From: linux-iio-ow...@vger.kernel.org 
> [mailto:linux-iio-ow...@vger.kernel.org] On Behalf Of Peter Meerwald-Stadler
> Sent: 28 March, 2016 20:43
> To: Tirdea, Irina
> Cc: Jonathan Cameron; linux-...@vger.kernel.org; 
> linux-kernel@vger.kernel.org; Hartmut Knaack; Lars-Peter Clausen; Markus
> Pargmann
> Subject: Re: [PATCH 1/1] iio: accel: bmc150: fix endianness when reading axes
> 
> On Mon, 28 Mar 2016, Irina Tirdea wrote:
> 
> > For big endian platforms, reading the axes will return
> > invalid values.
> >
> > The device stores each axis value in a 16 bit little
> > endian register. The driver uses regmap_read_bulk to get
> > the axis value, resulting in a 16 bit little endian value.
> > This needs to be converted to cpu endianness to work
> > on big endian platforms.
> >
> > Fix endianness for big endian platforms by converting
> > the values for the axes read from little endian to
> > cpu.
> >
> > This is also partially fixed in commit b6fb9b6d6552 ("iio:
> > accel: bmc150: optimize transfers in trigger handler").
> 
> looks good
> 
> in bmc150_accel_get_axis() the call to regmap_bulk_read() could now pass
> sizeof(raw_val) instead of 2
> 

Yes, that would look better. I'll send a new version with this change.

Thanks,
Irina

Reply via email to