From 4a630f55ec9455fbe23c9078bf7efa97e3ded53b Mon Sep 17 00:00:00 2001 From: Anjelique Melendez Date: Fri, 17 Dec 2021 10:18:39 -0800 Subject: [PATCH] iio: adc: qcom-spmi-adc5-gen3: Fix calls to qcom_adc5_hw_scale() Currently, calls to qcom_adc5_hw_scale() are passing in a prescale pointer. The qcom_adc5_hw_scale() function signature asks for the prescale int and interanally will get the prescale pointer. Fix this. Change-Id: I4cf630cf47f0b69678b69aecd5058e510bde6b3c Signed-off-by: Anjelique Melendez --- drivers/iio/adc/qcom-spmi-adc5-gen3.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/qcom-spmi-adc5-gen3.c b/drivers/iio/adc/qcom-spmi-adc5-gen3.c index 14f2c94f98cb..6418373578c1 100644 --- a/drivers/iio/adc/qcom-spmi-adc5-gen3.c +++ b/drivers/iio/adc/qcom-spmi-adc5-gen3.c @@ -684,8 +684,7 @@ static void tm_handler_work(struct work_struct *work) } } else { ret = qcom_adc5_hw_scale(chan_prop->scale_fn_type, - &adc5_prescale_ratios[chan_prop->prescale], - adc->data, code, &temp); + chan_prop->prescale, adc->data, code, &temp); if (ret < 0) { pr_err("Invalid temperature reading, ret=%d, code=0x%x\n", @@ -739,8 +738,7 @@ static int adc5_gen3_read_raw(struct iio_dev *indio_dev, return ret; ret = qcom_adc5_hw_scale(prop->scale_fn_type, - &adc5_prescale_ratios[prop->prescale], - adc->data, + prop->prescale, adc->data, adc_code_volt, val); if (ret < 0) return ret; @@ -793,8 +791,7 @@ int adc_tm_gen3_get_temp(void *data, int *temp) return ret; return qcom_adc5_hw_scale(prop->scale_fn_type, - &adc5_prescale_ratios[prop->prescale], - adc->data, + prop->prescale, adc->data, adc_code_volt, temp); }