]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/iio-dac-ds4422-ds4424-fix-chip-verification.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / queue-4.19 / iio-dac-ds4422-ds4424-fix-chip-verification.patch
1 From 60f2208699ec08ff9fdf1f97639a661a92a18f1c Mon Sep 17 00:00:00 2001
2 From: Ruslan Babayev <ruslan@babayev.com>
3 Date: Sun, 5 May 2019 12:24:37 -0700
4 Subject: iio: dac: ds4422/ds4424 fix chip verification
5
6 From: Ruslan Babayev <ruslan@babayev.com>
7
8 commit 60f2208699ec08ff9fdf1f97639a661a92a18f1c upstream.
9
10 The ds4424_get_value function takes channel number as it's 3rd
11 argument and translates it internally into I2C address using
12 DS4424_DAC_ADDR macro. The caller ds4424_verify_chip was passing an
13 already translated I2C address as its last argument.
14
15 Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
16 Cc: xe-linux-external@cisco.com
17 Cc: <Stable@vger.kernel.org>
18 Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 drivers/iio/dac/ds4424.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25 --- a/drivers/iio/dac/ds4424.c
26 +++ b/drivers/iio/dac/ds4424.c
27 @@ -166,7 +166,7 @@ static int ds4424_verify_chip(struct iio
28 {
29 int ret, val;
30
31 - ret = ds4424_get_value(indio_dev, &val, DS4424_DAC_ADDR(0));
32 + ret = ds4424_get_value(indio_dev, &val, 0);
33 if (ret < 0)
34 dev_err(&indio_dev->dev,
35 "%s failed. ret: %d\n", __func__, ret);