Commit 1180c883 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-3.8b' of...

Merge tag 'iio-for-3.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Second round of new IIO drivers and cleanups for the 3.8 cycle.

Usual mixed bag of cleanups and minor improvements including
one reversion for a patch in the previous series.

* adt7310 and adt7410 drivers merged into one.
* Revert use devm_kcalloc in at91_adc (because it doesn't exist)
* unlocking fix for error path in the ad5449
* isl29018 suspend and resume support.
* improved pseudo floating point parsing for info_mask write
attributes (and hence into write_raw).  Reject some messed up
strings.
parents abcdc99f 1e45cf3c
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -123,8 +123,10 @@ static int at91_adc_channel_init(struct iio_dev *idev)
	idev->num_channels = bitmap_weight(&st->channels_mask,
					   st->num_channels) + 1;

	chan_array = devm_kcalloc(&idev->dev, idev->num_channels + 1,
					sizeof(*chan_array), GFP_KERNEL);
	chan_array = devm_kzalloc(&idev->dev,
				  ((idev->num_channels + 1) *
					sizeof(struct iio_chan_spec)),
				  GFP_KERNEL);

	if (!chan_array)
		return -ENOMEM;
@@ -268,8 +270,9 @@ static int at91_adc_trigger_init(struct iio_dev *idev)
	struct at91_adc_state *st = iio_priv(idev);
	int i, ret;

	st->trig = devm_kcalloc(&idev->dev, st->trigger_number,
				sizeof(*st->trig), GFP_KERNEL);
	st->trig = devm_kzalloc(&idev->dev,
				st->trigger_number * sizeof(st->trig),
				GFP_KERNEL);

	if (st->trig == NULL) {
		ret = -ENOMEM;
@@ -451,8 +454,9 @@ static int at91_adc_probe_dt(struct at91_adc_state *st,
	st->registers->trigger_register = prop;

	st->trigger_number = of_get_child_count(node);
	st->trigger_list = devm_kcalloc(&idev->dev, st->trigger_number,
					sizeof(*st->trigger_list), GFP_KERNEL);
	st->trigger_list = devm_kzalloc(&idev->dev, st->trigger_number *
					sizeof(struct at91_adc_trigger),
					GFP_KERNEL);
	if (!st->trigger_list) {
		dev_err(&idev->dev, "Could not allocate trigger list memory.\n");
		ret = -ENOMEM;
+4 −3
Original line number Diff line number Diff line
@@ -124,12 +124,13 @@ static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,

	ret = spi_sync(st->spi, &msg);
	if (ret < 0)
		return ret;
		goto out_unlock;

	*val = be16_to_cpu(st->data[1]);
	mutex_unlock(&indio_dev->mlock);

	return 0;
out_unlock:
	mutex_unlock(&indio_dev->mlock);
	return ret;
}

static int ad5449_read_raw(struct iio_dev *indio_dev,
+3 −3
Original line number Diff line number Diff line
@@ -437,6 +437,8 @@ static ssize_t iio_write_channel_info(struct device *dev,
	if (buf[0] == '-') {
		negative = true;
		buf++;
	} else if (buf[0] == '+') {
		buf++;
	}

	while (*buf) {
@@ -445,8 +447,6 @@ static ssize_t iio_write_channel_info(struct device *dev,
				integer = integer*10 + *buf - '0';
			else {
				fract += fract_mult*(*buf - '0');
				if (fract_mult == 1)
					break;
				fract_mult /= 10;
			}
		} else if (*buf == '\n') {
@@ -454,7 +454,7 @@ static ssize_t iio_write_channel_info(struct device *dev,
				break;
			else
				return -EINVAL;
		} else if (*buf == '.') {
		} else if (*buf == '.' && integer_part) {
			integer_part = false;
		} else {
			return -EINVAL;
+3 −10
Original line number Diff line number Diff line
@@ -126,18 +126,11 @@ config AD7192
	  To compile this driver as a module, choose M here: the
	  module will be called ad7192.

config ADT7310
	tristate "Analog Devices ADT7310 temperature sensor driver"
	depends on SPI
	help
	  Say yes here to build support for Analog Devices ADT7310
	  temperature sensors.

config ADT7410
	tristate "Analog Devices ADT7410 temperature sensor driver"
	depends on I2C
	tristate "Analog Devices ADT7310/ADT7410 temperature sensor driver"
	depends on I2C || SPI_MASTER
	help
	  Say yes here to build support for Analog Devices ADT7410
	  Say yes here to build support for Analog Devices ADT7310/ADT7410
	  temperature sensors.

config AD7280
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ obj-$(CONFIG_AD7780) += ad7780.o
obj-$(CONFIG_AD7793) += ad7793.o
obj-$(CONFIG_AD7816) += ad7816.o
obj-$(CONFIG_AD7192) += ad7192.o
obj-$(CONFIG_ADT7310) += adt7310.o
obj-$(CONFIG_ADT7410) += adt7410.o
obj-$(CONFIG_AD7280) += ad7280a.o
obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o
Loading