Skip to content

Commit

Permalink
Merge tag 'iio-fixes-for-4.7b' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Greg Kroah-Hartman committed Jun 22, 2016
2 parents 33688ab + f4070a1 commit df01321
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
int i;
acpi_status status;
union acpi_object *cpm;
int ret;

status = acpi_evaluate_object(adev->handle, "CNF0", NULL, &buffer);
if (ACPI_FAILURE(status))
Expand All @@ -82,10 +83,10 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
}
}
}

ret = cpm->package.count;
kfree(buffer.pointer);

return cpm->package.count;
return ret;
}

static int acpi_i2c_check_resource(struct acpi_resource *ares, void *data)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/adc/ad7606_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static int ad7606_spi_read_block(struct device *dev,
{
struct spi_device *spi = to_spi_device(dev);
int i, ret;
unsigned short *data;
unsigned short *data = buf;
__be16 *bdata = buf;

ret = spi_read(spi, buf, count * 2);
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/iio/impedance-analyzer/ad5933.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev,
st->settling_cycles = val;

/* 2x, 4x handling, see datasheet */
if (val > 511)
val = (val >> 1) | (1 << 9);
else if (val > 1022)
if (val > 1022)
val = (val >> 2) | (3 << 9);
else if (val > 511)
val = (val >> 1) | (1 << 9);

dat = cpu_to_be16(val);
ret = ad5933_i2c_write(st->client,
Expand Down

0 comments on commit df01321

Please sign in to comment.