Commit df013212 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'iio-fixes-for-4.7b' of...

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

Jonathan writes:

Second set of IIO fixes for the 4.7 cycle.

This includes one tracked regression (Arnd's patch for the ad7606).
The other two have I think always been broken.

* inv_mpu6050
  - Fix a use after free in the ACPI code.
* ad5933
  - The code for setting the cycles had a bug that meant it was simply wrong.
* ad7606_spi
  - Fix a regression that got introduced in a buggy cleanup of a sparse
    warning.
parents 33688abb f4070a19
...@@ -56,6 +56,7 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev, ...@@ -56,6 +56,7 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
int i; int i;
acpi_status status; acpi_status status;
union acpi_object *cpm; union acpi_object *cpm;
int ret;
status = acpi_evaluate_object(adev->handle, "CNF0", NULL, &buffer); status = acpi_evaluate_object(adev->handle, "CNF0", NULL, &buffer);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
...@@ -82,10 +83,10 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev, ...@@ -82,10 +83,10 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
} }
} }
} }
ret = cpm->package.count;
kfree(buffer.pointer); kfree(buffer.pointer);
return cpm->package.count; return ret;
} }
static int acpi_i2c_check_resource(struct acpi_resource *ares, void *data) static int acpi_i2c_check_resource(struct acpi_resource *ares, void *data)
......
...@@ -21,7 +21,7 @@ static int ad7606_spi_read_block(struct device *dev, ...@@ -21,7 +21,7 @@ static int ad7606_spi_read_block(struct device *dev,
{ {
struct spi_device *spi = to_spi_device(dev); struct spi_device *spi = to_spi_device(dev);
int i, ret; int i, ret;
unsigned short *data; unsigned short *data = buf;
__be16 *bdata = buf; __be16 *bdata = buf;
ret = spi_read(spi, buf, count * 2); ret = spi_read(spi, buf, count * 2);
......
...@@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev, ...@@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev,
st->settling_cycles = val; st->settling_cycles = val;
/* 2x, 4x handling, see datasheet */ /* 2x, 4x handling, see datasheet */
if (val > 511) if (val > 1022)
val = (val >> 1) | (1 << 9);
else if (val > 1022)
val = (val >> 2) | (3 << 9); val = (val >> 2) | (3 << 9);
else if (val > 511)
val = (val >> 1) | (1 << 9);
dat = cpu_to_be16(val); dat = cpu_to_be16(val);
ret = ad5933_i2c_write(st->client, ret = ad5933_i2c_write(st->client,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment