Re: [PATCH 1/9] iio:common: Add STMicroelectronics common library

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

 



On 01/16/2013 05:30 PM, Denis CIOCCA wrote:
> Hi Lars-Peter,
> 
> thank you very much for your review!
> 
>>> +int st_sensors_read_axis_data(struct iio_dev *indio_dev, u8 ch_addr, int *data)
>>> +{
>>> +	int err;
>>> +	u8 outdata[ST_SENSORS_BYTE_FOR_CHANNEL];
>>> +	struct st_sensor_data *sdata = iio_priv(indio_dev);
>>> +
>>> +	err = sdata->tf->read_multiple_byte(&sdata->tb, sdata->dev,
>>> +			ch_addr, ST_SENSORS_BYTE_FOR_CHANNEL,
>>> +						outdata, sdata->multiread_bit);
>>> +	if (err < 0)
>>> +		goto read_error;
>>> +
>>> +	*data = ((s16)le16_to_cpup((__le16 *)outdata));
>>
>> Either make outdata a __le16 or use get_unaligned_le16.
> 
> get_unaligned_le16 doesn't do what I have done?

It does. But it takes a u8*. So you don't have to cast to __le16 *.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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