Commit 389c4245 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-fixes-for-6.12c' of...

Merge tag 'iio-fixes-for-6.12c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

IIO: 3rd set of fixes for the 6.12 cycle

Usual mixed bag of new issues from this cycle and ancient bugs
recently noticed.

core
- Fix wrong fwnode handle if __fwnode_iio_channel_get_by_name()
  looks at parents of the provider node.
core,backend
- Fix a wrong pointer error check.
gts library
- Fix plausible corner case where the value returned was not set.
- Avoid near infinite loop if the size of the table is 0.
  (neither are an issue for current drivers).
adi,ad4000
- Fix reading of unsigned channels that were returning garbage.
adi,ad7780
- Prevent a division by zero.
adi,ad7923
- Fix buffer overflows in arrays that were not resized when devices
  with more channels were added to the driver.
adi,adxl380
- Check only for negative error codes rather than including the
  positive channel read values in an error check.
invense,common
- Fix an issue where changing the sampling rate to another value and
  back again whilst the FIFO was off would not update things correctly.
kionix,kx022a
- Fix failure to sign extend value read from device.

* tag 'iio-fixes-for-6.12c' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: Fix fwnode_handle in __fwnode_iio_channel_get_by_name()
  iio: accel: adxl380: fix raw sample read
  iio: accel: kx022a: Fix raw read format
  iio: gts: fix infinite loop for gain_to_scaletables()
  iio: gts: Fix uninitialized symbol 'ret'
  iio: adc: ad4000: fix reading unsigned data
  ad7780: fix division by zero in ad7780_write_raw()
  iio: adc: ad7923: Fix buffer overflow for tx_buf and ring_xfer
  iio: backend: fix wrong pointer passed to IS_ERR()
  iio: invensense: fix multiple odr switch when FIFO is off
parents 65294beb 3993ca4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1181,7 +1181,7 @@ static int adxl380_read_raw(struct iio_dev *indio_dev,

		ret = adxl380_read_chn(st, chan->address);
		iio_device_release_direct_mode(indio_dev);
		if (ret)
		if (ret < 0)
			return ret;

		*val = sign_extend32(ret >> chan->scan_type.shift,
+1 −1
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ static int kx022a_get_axis(struct kx022a_data *data,
	if (ret)
		return ret;

	*val = le16_to_cpu(data->buffer[0]);
	*val = (s16)le16_to_cpu(data->buffer[0]);

	return IIO_VAL_INT;
}
+2 −0
Original line number Diff line number Diff line
@@ -344,6 +344,8 @@ static int ad4000_single_conversion(struct iio_dev *indio_dev,

	if (chan->scan_type.sign == 's')
		*val = sign_extend32(sample, chan->scan_type.realbits - 1);
	else
		*val = sample;

	return IIO_VAL_INT;
}
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static int ad7780_write_raw(struct iio_dev *indio_dev,

	switch (m) {
	case IIO_CHAN_INFO_SCALE:
		if (val != 0)
		if (val != 0 || val2 == 0)
			return -EINVAL;

		vref = st->int_vref_mv * 1000000LL;
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@

struct ad7923_state {
	struct spi_device		*spi;
	struct spi_transfer		ring_xfer[5];
	struct spi_transfer		ring_xfer[9];
	struct spi_transfer		scan_single_xfer[2];
	struct spi_message		ring_msg;
	struct spi_message		scan_single_msg;
@@ -64,7 +64,7 @@ struct ad7923_state {
	 * Length = 8 channels + 4 extra for 8 byte timestamp
	 */
	__be16				rx_buf[12] __aligned(IIO_DMA_MINALIGN);
	__be16				tx_buf[4];
	__be16				tx_buf[8];
};

struct ad7923_chip_info {
Loading