diff options
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 1 | ||||
-rw-r--r-- | drivers/iio/dac/ad7303.c | 4 | ||||
-rw-r--r-- | drivers/iio/industrialio-trigger.c | 2 | ||||
-rw-r--r-- | drivers/iio/inkern.c | 2 | ||||
-rw-r--r-- | drivers/iio/pressure/st_pressure_core.c | 6 |
5 files changed, 10 insertions, 5 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 4427e8e46a7f..0ad208a69c29 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -183,6 +183,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, static const struct iio_info tiadc_info = { .read_raw = &tiadc_read_raw, + .driver_module = THIS_MODULE, }; static int tiadc_probe(struct platform_device *pdev) diff --git a/drivers/iio/dac/ad7303.c b/drivers/iio/dac/ad7303.c index 85aeef60dc5f..d546f50f9258 100644 --- a/drivers/iio/dac/ad7303.c +++ b/drivers/iio/dac/ad7303.c @@ -235,8 +235,10 @@ static int ad7303_probe(struct spi_device *spi) if (ext_ref) { st->vref_reg = regulator_get(&spi->dev, "REF"); - if (IS_ERR(st->vref_reg)) + if (IS_ERR(st->vref_reg)) { + ret = PTR_ERR(st->vref_reg); goto err_disable_vdd_reg; + } ret = regulator_enable(st->vref_reg); if (ret) diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index 4d6c7d84e155..ea8a4146620d 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -104,7 +104,7 @@ void iio_trigger_unregister(struct iio_trigger *trig_info) ida_simple_remove(&iio_trigger_ida, trig_info->id); /* Possible issue in here */ - device_unregister(&trig_info->dev); + device_del(&trig_info->dev); } EXPORT_SYMBOL(iio_trigger_unregister); diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 98ddc323add0..0cf5f8e06cfc 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -451,7 +451,7 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan, int ret; ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_OFFSET); - if (ret == 0) + if (ret >= 0) raw64 += offset; scale_type = iio_channel_read(chan, &scale_val, &scale_val2, diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c index 9c343b40665e..3ffbc56917b4 100644 --- a/drivers/iio/pressure/st_pressure_core.c +++ b/drivers/iio/pressure/st_pressure_core.c @@ -28,7 +28,9 @@ #include <linux/iio/common/st_sensors.h> #include "st_pressure.h" -#define ST_PRESS_MBAR_TO_KPASCAL(x) (x * 10) +#define ST_PRESS_LSB_PER_MBAR 4096UL +#define ST_PRESS_KPASCAL_NANO_SCALE (100000000UL / \ + ST_PRESS_LSB_PER_MBAR) #define ST_PRESS_NUMBER_DATA_CHANNELS 1 /* DEFAULT VALUE FOR SENSORS */ @@ -51,8 +53,8 @@ #define ST_PRESS_1_FS_ADDR 0x23 #define ST_PRESS_1_FS_MASK 0x30 #define ST_PRESS_1_FS_AVL_1260_VAL 0x00 -#define ST_PRESS_1_FS_AVL_1260_GAIN ST_PRESS_MBAR_TO_KPASCAL(244141) #define ST_PRESS_1_FS_AVL_TEMP_GAIN 2083000 +#define ST_PRESS_1_FS_AVL_1260_GAIN ST_PRESS_KPASCAL_NANO_SCALE #define ST_PRESS_1_BDU_ADDR 0x20 #define ST_PRESS_1_BDU_MASK 0x04 #define ST_PRESS_1_DRDY_IRQ_ADDR 0x22 |