Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO fixes from Greg KH:
"Here are a few small staging and iio driver fixes for 4.7-rc6.

Nothing major here, just a number of small fixes, all have been in
linux-next for a while, and the full details are in the shortlog"

* tag 'staging-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
iio:ad7266: Fix probe deferral for vref
iio:ad7266: Fix support for optional regulators
iio:ad7266: Fix broken regulator error handling
iio: accel: kxsd9: fix the usage of spi_w8r8()
staging: iio: accel: fix error check
staging: iio: ad5933: fix order of cycle conditions
staging: iio: fix ad7606_spi regression
iio: inv_mpu6050: Fix use-after-free in ACPI code

+15 -11
+2 -2
drivers/iio/accel/kxsd9.c
··· 81 81 82 82 mutex_lock(&st->buf_lock); 83 83 ret = spi_w8r8(st->us, KXSD9_READ(KXSD9_REG_CTRL_C)); 84 - if (ret) 84 + if (ret < 0) 85 85 goto error_ret; 86 86 st->tx[0] = KXSD9_WRITE(KXSD9_REG_CTRL_C); 87 87 st->tx[1] = (ret & ~KXSD9_FS_MASK) | i; ··· 163 163 break; 164 164 case IIO_CHAN_INFO_SCALE: 165 165 ret = spi_w8r8(st->us, KXSD9_READ(KXSD9_REG_CTRL_C)); 166 - if (ret) 166 + if (ret < 0) 167 167 goto error_ret; 168 168 *val2 = kxsd9_micro_scales[ret & KXSD9_FS_MASK]; 169 169 ret = IIO_VAL_INT_PLUS_MICRO;
+5 -2
drivers/iio/adc/ad7266.c
··· 396 396 397 397 st = iio_priv(indio_dev); 398 398 399 - st->reg = devm_regulator_get(&spi->dev, "vref"); 400 - if (!IS_ERR_OR_NULL(st->reg)) { 399 + st->reg = devm_regulator_get_optional(&spi->dev, "vref"); 400 + if (!IS_ERR(st->reg)) { 401 401 ret = regulator_enable(st->reg); 402 402 if (ret) 403 403 return ret; ··· 408 408 409 409 st->vref_mv = ret / 1000; 410 410 } else { 411 + /* Any other error indicates that the regulator does exist */ 412 + if (PTR_ERR(st->reg) != -ENODEV) 413 + return PTR_ERR(st->reg); 411 414 /* Use internal reference */ 412 415 st->vref_mv = 2500; 413 416 }
+3 -2
drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
··· 56 56 int i; 57 57 acpi_status status; 58 58 union acpi_object *cpm; 59 + int ret; 59 60 60 61 status = acpi_evaluate_object(adev->handle, "CNF0", NULL, &buffer); 61 62 if (ACPI_FAILURE(status)) ··· 83 82 } 84 83 } 85 84 } 86 - 85 + ret = cpm->package.count; 87 86 kfree(buffer.pointer); 88 87 89 - return cpm->package.count; 88 + return ret; 90 89 } 91 90 92 91 static int acpi_i2c_check_resource(struct acpi_resource *ares, void *data)
+1 -1
drivers/staging/iio/accel/sca3000_core.c
··· 594 594 goto error_ret_mut; 595 595 ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL); 596 596 mutex_unlock(&st->lock); 597 - if (ret) 597 + if (ret < 0) 598 598 goto error_ret; 599 599 val = ret; 600 600 if (base_freq > 0)
+1 -1
drivers/staging/iio/adc/ad7606_spi.c
··· 21 21 { 22 22 struct spi_device *spi = to_spi_device(dev); 23 23 int i, ret; 24 - unsigned short *data; 24 + unsigned short *data = buf; 25 25 __be16 *bdata = buf; 26 26 27 27 ret = spi_read(spi, buf, count * 2);
+3 -3
drivers/staging/iio/impedance-analyzer/ad5933.c
··· 444 444 st->settling_cycles = val; 445 445 446 446 /* 2x, 4x handling, see datasheet */ 447 - if (val > 511) 448 - val = (val >> 1) | (1 << 9); 449 - else if (val > 1022) 447 + if (val > 1022) 450 448 val = (val >> 2) | (3 << 9); 449 + else if (val > 511) 450 + val = (val >> 1) | (1 << 9); 451 451 452 452 dat = cpu_to_be16(val); 453 453 ret = ad5933_i2c_write(st->client,