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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJXZviuAAoJEFSFNJnE9BaIrTUP/is71ktnzRgiwthdLU4w0uPU
 +ueU9VgCOsSTfXnFl4GwB90gc3/JjLLxkrF3xEthbPxIBBA5BcptLtWI3bIIPsDR
 WiV+FqJDMitafYKRmyxwPf9CaUlwUqB62KeaPtN7nNpLXTYTVJe0XSdNoAD8nZQ9
 v94yFr6l2tkzcQitAH7xT4ho+Gjn4K/CmugaWW4wJ69nwgUzXr9pS8ULcN2jI0td
 EcQVxAK5FX4J5sldFlMF0sLLqO+KdVRYZZUib98CINiJCh0SBy2aN8088+7tA0BU
 kqOOrDO1RQW1cMpY9UZzfUm/GpxM60obPOkw4cfVSL86MJw1eQYJ+LvMzeDcNf/S
 qxDNMQmjFeg+uiYvMsjIhvwbM+ijbhOodoKr60L09ruMHcF8xG4teCBsyXlBgNNC
 f97ABHfpNniPw4Rbak3pMmgtnwceOFPf+xv/QUNSfWpd/TbpFvEe4Ts3Q/xa4d5B
 56N96rqGwxZ7KWqn0VIJO5F2wSuLUjHCkDe3Z2PQ+Cf+yJqLTmutpa9SueCNvVZK
 PQ2nlsCMgeq1JiTaqCyCkemA1Ne/sWwx4yD3zRc23XOytLc6MdStBq+T98C+avAu
 oCP4JXG+ewsefzyLBp+gB2NSN0MLFJeD/CmdMD+d2YL5Ag0N/TydexdNVmonnyR9
 LlbpVZdwJemQJ5oVv+Ar
 =fw4z
 -----END PGP SIGNATURE-----

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.
This commit is contained in:
Greg Kroah-Hartman 2016-06-22 09:57:28 -07:00
commit df013212a1
3 changed files with 7 additions and 6 deletions

View file

@ -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))
@ -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)

View file

@ -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);

View file

@ -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,