diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-27 15:05:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-27 15:05:05 +0100 |
commit | 6e6df27064aa0a95b6c8a2e2757de35a244649a5 (patch) | |
tree | 1f0325ed606a6355a70ec5100f8341f29550c044 /drivers/iio/adc | |
parent | 75621ae307caf4efa0a61152b667bf7083850ffe (diff) | |
parent | 86fdd15e10e404e70ecb2a3bff24d70356d42b36 (diff) | |
download | lwn-6e6df27064aa0a95b6c8a2e2757de35a244649a5.tar.gz lwn-6e6df27064aa0a95b6c8a2e2757de35a244649a5.zip |
Merge tag 'iio-fixes-for-6.1d' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:
4th set of IIO fixes for 6.1
Single patch fixing a memory leak in an error path.
Fine to queue either for 6.2 if too late for 6.1
* tag 'iio-fixes-for-6.1d' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
iio: fix memory leak in iio_device_register_eventset()
dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid"
iio: adc: aspeed: Remove the trim valid dts property.
iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails
iio: accel: bma400: Fix memory leak in bma400_get_steps_reg()
iio: light: rpr0521: add missing Kconfig dependencies
iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw
iio: health: afe4403: Fix oob read in afe4403_read_raw
iio: light: apds9960: fix wrong register for gesture gain
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/aspeed_adc.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c index 9341e0e0eb55..998e8bcc06e1 100644 --- a/drivers/iio/adc/aspeed_adc.c +++ b/drivers/iio/adc/aspeed_adc.c @@ -202,6 +202,8 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev) ((scu_otp) & (data->model_data->trim_locate->field)) >> __ffs(data->model_data->trim_locate->field); + if (!trimming_val) + trimming_val = 0x8; } dev_dbg(data->dev, "trimming val = %d, offset = %08x, fields = %08x\n", @@ -563,12 +565,9 @@ static int aspeed_adc_probe(struct platform_device *pdev) if (ret) return ret; - if (of_find_property(data->dev->of_node, "aspeed,trim-data-valid", - NULL)) { - ret = aspeed_adc_set_trim_data(indio_dev); - if (ret) - return ret; - } + ret = aspeed_adc_set_trim_data(indio_dev); + if (ret) + return ret; if (of_find_property(data->dev->of_node, "aspeed,battery-sensing", NULL)) { |