Merge tag 'iio-fixes-for-4.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Feb 2016 21:07:38 +0000 (13:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Feb 2016 21:07:38 +0000 (13:07 -0800)
Jonathan writes:

First set of IIO fixes for the 4.5 cycle.

This set comprises those not dependent on patches in the 4.5 merge cycle.
A second set will follow shortly with ones that are.

* core in kernel interfaces
  - fix a possible NULL dereference that is a theoretical possibility
    via odd usage of iio_channel_release. Pretty much a hardening of
    the interface, but observed in the wild with the twl4030_charger
    driver.
* acpi-als
  - report the data as processed as it is in lux.  This fixes a wrong
    use of the IIO ABI.  However, old _raw version retained to avoid
    breaking any userspace in the wild that is relying on that (none
    known but it doesn't hurt us much to retain it)
ade7753
  - fix some error handling to avoid use of unitialized data.
* ltr501
  - use a signed return type for ltr501_match_samp_freq so as to allow
    returning of an error code.
* mcp4725
  - set name field of struct iio_dev to ensure the sysfs name attribute
    doesn't give NULL.
* mpl115
  - temperature offset sign is wrong.
* stk8ba50
  - IIO_TRIGGER dependency added
* ti_am335x_adc
  - Label buffer as a software buffer. It's actually a hybrid of a
    true hardware buffer feeding a kfifo, but the meaning of these fields
    has changed a little recently and in this case it should be labeled
    a software buffer ensure it is allowed to use the kfifo.
* vf610_adc
  - HAS_IOMEM dependency

1  2 
drivers/iio/accel/Kconfig
drivers/iio/adc/Kconfig
drivers/iio/inkern.c

@@@ -64,7 -64,7 +64,7 @@@ config IIO_ST_ACCEL_3AXI
        help
          Say yes here to build support for STMicroelectronics accelerometers:
          LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
 -        LIS331DLH, LSM303DL, LSM303DLM, LSM330.
 +        LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12.
  
          This driver can also be built as a module. If so, these modules
          will be created:
@@@ -107,35 -107,6 +107,35 @@@ config KXCJK101
          To compile this driver as a module, choose M here: the module will
          be called kxcjk-1013.
  
 +config MMA7455
 +      tristate
 +      select IIO_BUFFER
 +      select IIO_TRIGGERED_BUFFER
 +
 +config MMA7455_I2C
 +      tristate "Freescale MMA7455L/MMA7456L Accelerometer I2C Driver"
 +      depends on I2C
 +      select MMA7455
 +      select REGMAP_I2C
 +      help
 +        Say yes here to build support for the Freescale MMA7455L and
 +        MMA7456L 3-axis accelerometer.
 +
 +        To compile this driver as a module, choose M here: the module
 +        will be called mma7455_i2c.
 +
 +config MMA7455_SPI
 +      tristate "Freescale MMA7455L/MMA7456L Accelerometer SPI Driver"
 +      depends on SPI_MASTER
 +      select MMA7455
 +      select REGMAP_SPI
 +      help
 +        Say yes here to build support for the Freescale MMA7455L and
 +        MMA7456L 3-axis accelerometer.
 +
 +        To compile this driver as a module, choose M here: the module
 +        will be called mma7455_spi.
 +
  config MMA8452
        tristate "Freescale MMA8452Q and similar Accelerometers Driver"
        depends on I2C
@@@ -187,17 -158,6 +187,17 @@@ config MXC400
          To compile this driver as a module, choose M. The module will be
          called mxc4005.
  
 +config MXC6255
 +      tristate "Memsic MXC6255 Orientation Sensing Accelerometer Driver"
 +      depends on I2C
 +      select REGMAP_I2C
 +      help
 +        Say yes here to build support for the Memsic MXC6255 Orientation
 +        Sensing Accelerometer Driver.
 +
 +        To compile this driver as a module, choose M here: the module will be
 +        called mxc6255.
 +
  config STK8312
        tristate "Sensortek STK8312 3-Axis Accelerometer Driver"
        depends on I2C
  config STK8BA50
        tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
        depends on I2C
+       depends on IIO_TRIGGER
        help
          Say yes here to get support for the Sensortek STK8BA50 3-axis
          accelerometer.
diff --combined drivers/iio/adc/Kconfig
@@@ -194,25 -194,6 +194,25 @@@ config HI843
          This driver can also be built as a module. If so, the module will be
          called hi8435.
  
 +config INA2XX_ADC
 +      tristate "Texas Instruments INA2xx Power Monitors IIO driver"
 +      depends on I2C && !SENSORS_INA2XX
 +      select REGMAP_I2C
 +      select IIO_BUFFER
 +      select IIO_KFIFO_BUF
 +      help
 +        Say yes here to build support for TI INA2xx family of Power Monitors.
 +        This driver is mutually exclusive with the HWMON version.
 +
 +config IMX7D_ADC
 +      tristate "IMX7D ADC driver"
 +      depends on ARCH_MXC || COMPILE_TEST
 +      help
 +        Say yes here to build support for IMX7D ADC.
 +
 +        This driver can also be built as a module. If so, the module will be
 +        called imx7d_adc.
 +
  config LP8788_ADC
        tristate "LP8788 ADC driver"
        depends on MFD_LP8788
@@@ -294,14 -275,6 +294,14 @@@ config NAU780
          To compile this driver as a module, choose M here: the
          module will be called nau7802.
  
 +config PALMAS_GPADC
 +      tristate "TI Palmas General Purpose ADC"
 +      depends on MFD_PALMAS
 +      help
 +        Palmas series pmic chip by Texas Instruments (twl6035/6037)
 +        is used in smartphones and tablets and supports a 16 channel
 +        general purpose ADC.
 +
  config QCOM_SPMI_IADC
        tristate "Qualcomm SPMI PMIC current ADC"
        depends on SPMI
@@@ -351,25 -324,15 +351,25 @@@ config TI_ADC081
          called ti-adc081c.
  
  config TI_ADC128S052
 -      tristate "Texas Instruments ADC128S052/ADC122S021"
 +      tristate "Texas Instruments ADC128S052/ADC122S021/ADC124S021"
        depends on SPI
        help
 -        If you say yes here you get support for Texas Instruments ADC128S052
 -        and ADC122S021 chips.
 +        If you say yes here you get support for Texas Instruments ADC128S052,
 +        ADC122S021 and ADC124S021 chips.
  
          This driver can also be built as a module. If so, the module will be
          called ti-adc128s052.
  
 +config TI_ADS8688
 +      tristate "Texas Instruments ADS8688"
 +      depends on SPI && OF
 +      help
 +        If you say yes here you get support for Texas Instruments ADS8684 and
 +        and ADS8688 ADC chips
 +
 +        This driver can also be built as a module. If so, the module will be
 +        called ti-ads8688.
 +
  config TI_AM335X_ADC
        tristate "TI's AM335X ADC driver"
        depends on MFD_TI_AM335X_TSCADC
@@@ -409,6 -372,7 +409,7 @@@ config TWL6030_GPAD
  config VF610_ADC
        tristate "Freescale vf610 ADC driver"
        depends on OF
+       depends on HAS_IOMEM
        select IIO_BUFFER
        select IIO_TRIGGERED_BUFFER
        help
diff --combined drivers/iio/inkern.c
@@@ -61,10 -61,12 +61,10 @@@ EXPORT_SYMBOL_GPL(iio_map_array_registe
  int iio_map_array_unregister(struct iio_dev *indio_dev)
  {
        int ret = -ENODEV;
 -      struct iio_map_internal *mapi;
 -      struct list_head *pos, *tmp;
 +      struct iio_map_internal *mapi, *next;
  
        mutex_lock(&iio_map_list_lock);
 -      list_for_each_safe(pos, tmp, &iio_map_list) {
 -              mapi = list_entry(pos, struct iio_map_internal, l);
 +      list_for_each_entry_safe(mapi, next, &iio_map_list, l) {
                if (indio_dev == mapi->indio_dev) {
                        list_del(&mapi->l);
                        kfree(mapi);
@@@ -349,6 -351,8 +349,8 @@@ EXPORT_SYMBOL_GPL(iio_channel_get)
  
  void iio_channel_release(struct iio_channel *channel)
  {
+       if (!channel)
+               return;
        iio_device_put(channel->indio_dev);
        kfree(channel);
  }