summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/fsl-imx25-gcq.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-01 18:13:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-01 18:13:42 -0700
commit1c4ccab04a214604eff40e26649cdf00a7930506 (patch)
tree836084fe8b5b5f1e2b75adf59cd3d7dcbb8cd9af /drivers/iio/adc/fsl-imx25-gcq.c
parente2c3860ba27d21f991bf9b81d64589f7c9e087c1 (diff)
parent8911a43bc198877fad9f4b0246a866b26bb547ab (diff)
Merge tag 'iio-for-4.20b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: Second set of IIO new device support features and cleanup for the 4.20 cycle. One merge commit in here to bring in the SPI_CS_WORD flag patches that are also going via the SPI tree. There are a few more fixes than normal for a pull targetting the next merge window. These are all long term issues and as we are late in the cycle, they can wait. New device support * ad7606 - Add support fo the ad7605-4 driver. This driver is still in staging but is heading in the right direction to graduate, motivated partly by the requirement for this device support. * ST VL53L0X ToF ranging sensor - New minimal driver. Interrupt support to follow. New features * SPI_CS_WORD optimization allows long transfers with the chip select toggled every 16bits. There is a software fallback as well to let drivers not care about whether the hardware supports it. * bh1750 - Device tree support and bindings. * ti-ads7950 - Use the SPI_CS_WORD optmization to save lots of cpu cycles (assuming the hardware supports it) Fixes and cleanups * ad5064 - Fix some long incorrect regulator error handling that preventing enabling the internal regulator. * ad7606 - The ad7606 doesn't actually have a 2.5V range and the values provided for scale have always been wrong. Fix them. - Drop some wrong kernel-doc (things that don't exist) - Add missing kernel-doc * at91-adc - Fixing missing ack of dataready on sysfs channel reads to avoid spurious interrupts. - Fix a wrong channel numbers in triggered_buffer_mode * hmc5843 - Fix incorrect part number in a comment. * imx25-gcq - Fix a device_node leak in an error path. * meson-saradc - Drop an unused and pointless define. - Use of_device_get_match_data instead of opencoding - Tidy up how meson_sar_adc_param is accessed. - Rework prior to adding some temperature sensor support. * tag 'iio-for-4.20b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: ad5064: Fix regulator handling iio: adc: meson-saradc: use the address attribute from iio_chan_spec iio: adc: meson-saradc: do not use meson_sar_adc_iio_channels directly iio: adc: at91: fix wrong channel number in triggered buffer mode iio: adc: at91: fix acking DRDY irq on simple conversions iio: adc: meson-saradc: simplify access to meson_sar_adc_param iio: adc: meson-saradc: use of_device_get_match_data iio: adc: meson-saradc: remove #define MESON_SAR_ADC_DELTA_10_TS_C_SHIFT iio: light: bh1750: Add device tree support dt-bindings: iio: light: bh1750: Add device tree binding documentation staging:iio:ad7606: Add support for the ad7605-4 iio: proximity: Add driver support for ST's VL53L0X ToF ranging sensor. staging:iio:ad7606: update structs with doc annotations iio: magnetometer: hmc5843: Fixed a comment error. iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs() iio: adc: ti-ads7950: use SPI_CS_WORD to reduce CPU usage spi: add software implementation for SPI_CS_WORD spi: add new SPI_CS_WORD flag staging:iio:ad7606: Remove incorrect kernel doc annotations staging:iio:ad7606: fix voltage scales
Diffstat (limited to 'drivers/iio/adc/fsl-imx25-gcq.c')
-rw-r--r--drivers/iio/adc/fsl-imx25-gcq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index ea264fa9e567..929c617db364 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -209,12 +209,14 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
ret = of_property_read_u32(child, "reg", &reg);
if (ret) {
dev_err(dev, "Failed to get reg property\n");
+ of_node_put(child);
return ret;
}
if (reg >= MX25_NUM_CFGS) {
dev_err(dev,
"reg value is greater than the number of available configuration registers\n");
+ of_node_put(child);
return -EINVAL;
}
@@ -228,6 +230,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
if (IS_ERR(priv->vref[refp])) {
dev_err(dev, "Error, trying to use external voltage reference without a vref-%s regulator.",
mx25_gcq_refp_names[refp]);
+ of_node_put(child);
return PTR_ERR(priv->vref[refp]);
}
priv->channel_vref_mv[reg] =
@@ -240,6 +243,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
break;
default:
dev_err(dev, "Invalid positive reference %d\n", refp);
+ of_node_put(child);
return -EINVAL;
}
@@ -254,10 +258,12 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
if ((refp & MX25_ADCQ_CFG_REFP_MASK) != refp) {
dev_err(dev, "Invalid fsl,adc-refp property value\n");
+ of_node_put(child);
return -EINVAL;
}
if ((refn & MX25_ADCQ_CFG_REFN_MASK) != refn) {
dev_err(dev, "Invalid fsl,adc-refn property value\n");
+ of_node_put(child);
return -EINVAL;
}