First set of IIO fixes for the 4.19 cycle.

* ad9523
   - sysfs write should return the number of characters used or an error, not
     0 which could result in an infinite loop in userspace.
 * lsm6dsx
   - Fix computation of length when updating the watermark to include
     timestamps avoiding the watermark being set earlier than intended.
 * maxim_thermocouple
   - Revert a patch adding the max31856 as it's not actually compatible with
     the register set that this driver supports.
 * si1133
   - Fix an impossible value check so we don't always error out whether the
     passed in value is good or bad.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAluT5xsRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FoigZw//Vz2eN34K6kOtUraflE8Rz7stucavQE11
 mufAC8l5lXSSC+xTvNepaoFyGelcXc/brgU+1cO/9FRdZswm86BfyL6xvR0x1kw9
 Y5HZiMk+4zL1gNHgyTTLyXE5ELN2dJXeJ9Tbtw6Vdwbd97KI1ZKURQhI1KFWhaFb
 6Ut/fnoCbzhkkf1NQxZpxLiS43Ii3hX6GMTyMi6WsaxvA/dHFZHTxOYf+K9FmzGz
 NZJWn8jhK/dJMWGLLeJrMosZCjXxP36fMwJXaP9lLQqKYIl3Ut8yo5GQzzJvzWM9
 q+C+1mifJlkM1hQkLQDG/O3fJHP0s+U1HlRIqfP1tDUyC2Jl8rrkSpAj0/jXgxw9
 kw5FkXPXOmP+4VzGH6MzzYPwU/1ysC+gC040WHNuxxZAdfHnRqEUevZQPtSYbmBq
 MfYurPuOXCpdepCxbZKxPepvFebdwSRofiEjnTFG2jV4tvKvJCCnTlMf1Xv1J7jy
 qhw2EGBvgBDcUngGXAzA+N+MN1kmFaKrJr4bH9OMh8EW2Yns/wLOqkz9yiEks4qc
 n2HARsVkmwYQn70mWal7zrAzmi6LVeIEjlTt7cEg2F7YhhF6Tx0vJlnh30C1+L9M
 DrOILNQnDUz+YFLljHQFZCQbwLu87N9Jit8MGo/vKSs1l1i7G/ojZ6mDg06nApQu
 3p3neRejc8M=
 =/Eyr
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First set of IIO fixes for the 4.19 cycle.

* ad9523
  - sysfs write should return the number of characters used or an error, not
    0 which could result in an infinite loop in userspace.
* lsm6dsx
  - Fix computation of length when updating the watermark to include
    timestamps avoiding the watermark being set earlier than intended.
* maxim_thermocouple
  - Revert a patch adding the max31856 as it's not actually compatible with
    the register set that this driver supports.
* si1133
  - Fix an impossible value check so we don't always error out whether the
    passed in value is good or bad.
This commit is contained in:
Greg Kroah-Hartman 2018-09-09 09:33:29 +02:00
commit eca743dc37
2 changed files with 6 additions and 8 deletions

View File

@ -187,12 +187,15 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor,
int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
{
u16 fifo_watermark = ~0, cur_watermark, sip = 0, fifo_th_mask;
u16 fifo_watermark = ~0, cur_watermark, fifo_th_mask;
struct st_lsm6dsx_hw *hw = sensor->hw;
struct st_lsm6dsx_sensor *cur_sensor;
int i, err, data;
__le16 wdata;
if (!hw->sip)
return 0;
for (i = 0; i < ST_LSM6DSX_ID_MAX; i++) {
cur_sensor = iio_priv(hw->iio_devs[i]);
@ -203,14 +206,10 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
: cur_sensor->watermark;
fifo_watermark = min_t(u16, fifo_watermark, cur_watermark);
sip += cur_sensor->sip;
}
if (!sip)
return 0;
fifo_watermark = max_t(u16, fifo_watermark, sip);
fifo_watermark = (fifo_watermark / sip) * sip;
fifo_watermark = max_t(u16, fifo_watermark, hw->sip);
fifo_watermark = (fifo_watermark / hw->sip) * hw->sip;
fifo_watermark = fifo_watermark * hw->settings->fifo_ops.th_wl;
err = regmap_read(hw->regmap, hw->settings->fifo_ops.fifo_th.addr + 1,

View File

@ -258,7 +258,6 @@ static int maxim_thermocouple_remove(struct spi_device *spi)
static const struct spi_device_id maxim_thermocouple_id[] = {
{"max6675", MAX6675},
{"max31855", MAX31855},
{"max31856", MAX31855},
{},
};
MODULE_DEVICE_TABLE(spi, maxim_thermocouple_id);