]> Git Repo - linux.git/commitdiff
Merge tag 'iio-fixes-for-4.2b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
authorGreg Kroah-Hartman <[email protected]>
Mon, 13 Jul 2015 21:19:22 +0000 (14:19 -0700)
committerGreg Kroah-Hartman <[email protected]>
Mon, 13 Jul 2015 21:19:22 +0000 (14:19 -0700)
Jonathan writes:

Second set of IIO fixes for the 4.2 cycle. Note these depend (mostly) on
material in the recent merge window, hence their separation from set (a)
as the fixes-togreg branch predated the merge window.  I am running rather
later with these than I would have liked hence the large set.

* stk3310 fixes from Hartmut's review that came in post merge
  - fix direction of proximity inline with recent documentation
    clarification.
  - fix missing REGMAP_I2C dependency
  - rework the error handling for raw readings to fix an failure to power
    down in the event of a raw reading failing.
  - fix a bug in the compensation code which was toggling an extra bit in the
    register.
* mmc35240 - reported samplign frequencies were wrong.
* ltr501 fixes
  - fix a case of returning the return value of a regmap_read instead of
    the value read.
  - fix missing regmap dependency
* sx9500 - fix missing default values for ret in a couple of places to handle
  the case of no enabled channels.
* tmp006 - check that writes to info_mask elements are actually to writable
  ones.  Otherwise, writing to any of them will change the sampling frequency.

1  2 
drivers/iio/proximity/sx9500.c

index 01494cd6fa32fe791082699eef66a773ded1cc28,42072e041b563719bcdc58a912fb0a960eaab363..3d756bd8c703230bfc93f530d03399f9f5e1413f
@@@ -80,6 -80,7 +80,7 @@@
  #define SX9500_COMPSTAT_MASK          GENMASK(3, 0)
  
  #define SX9500_NUM_CHANNELS           4
+ #define SX9500_CHAN_MASK              GENMASK(SX9500_NUM_CHANNELS - 1, 0)
  
  struct sx9500_data {
        struct mutex mutex;
@@@ -281,7 -282,7 +282,7 @@@ static int sx9500_read_prox_data(struc
        if (ret < 0)
                return ret;
  
 -      *val = 32767 - (s16)be16_to_cpu(regval);
 +      *val = be16_to_cpu(regval);
  
        return IIO_VAL_INT;
  }
@@@ -329,20 -330,20 +330,20 @@@ static int sx9500_read_proximity(struc
        else
                ret = sx9500_wait_for_sample(data);
  
-       if (ret < 0)
-               return ret;
        mutex_lock(&data->mutex);
  
-       ret = sx9500_read_prox_data(data, chan, val);
        if (ret < 0)
-               goto out;
+               goto out_dec_data_rdy;
  
-       ret = sx9500_dec_chan_users(data, chan->channel);
+       ret = sx9500_read_prox_data(data, chan, val);
        if (ret < 0)
-               goto out;
+               goto out_dec_data_rdy;
  
        ret = sx9500_dec_data_rdy_users(data);
+       if (ret < 0)
+               goto out_dec_chan;
+       ret = sx9500_dec_chan_users(data, chan->channel);
        if (ret < 0)
                goto out;
  
  
        goto out;
  
+ out_dec_data_rdy:
+       sx9500_dec_data_rdy_users(data);
  out_dec_chan:
        sx9500_dec_chan_users(data, chan->channel);
  out:
@@@ -679,7 -682,7 +682,7 @@@ out
  static int sx9500_buffer_preenable(struct iio_dev *indio_dev)
  {
        struct sx9500_data *data = iio_priv(indio_dev);
-       int ret, i;
+       int ret = 0, i;
  
        mutex_lock(&data->mutex);
  
  static int sx9500_buffer_predisable(struct iio_dev *indio_dev)
  {
        struct sx9500_data *data = iio_priv(indio_dev);
-       int ret, i;
+       int ret = 0, i;
  
        iio_triggered_buffer_predisable(indio_dev);
  
@@@ -800,8 -803,7 +803,7 @@@ static int sx9500_init_compensation(str
        unsigned int val;
  
        ret = regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
-                                GENMASK(SX9500_NUM_CHANNELS, 0),
-                                GENMASK(SX9500_NUM_CHANNELS, 0));
+                                SX9500_CHAN_MASK, SX9500_CHAN_MASK);
        if (ret < 0)
                return ret;
  
  
  out:
        regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
-                          GENMASK(SX9500_NUM_CHANNELS, 0), 0);
+                          SX9500_CHAN_MASK, 0);
        return ret;
  }
  
This page took 0.06447 seconds and 4 git commands to generate.