]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Staging: iio: adt7316: Fix i2c data reading, set the data field
authorShreeya Patel <shreeya.patel23498@gmail.com>
Fri, 16 Nov 2018 22:49:07 +0000 (04:19 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 17 Nov 2018 16:57:09 +0000 (16:57 +0000)
adt7316_i2c_read function nowhere sets the data field.
It is necessary to have an appropriate value for it.
Hence, assign the value stored in 'ret' variable to data field.

This is an ancient bug, and as no one seems to have noticed,
probably no sense in applying it to stable.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/addac/adt7316-i2c.c

index f66dd3ebbab1fe787fccc180b70441a4e598ab09..856bcfa60c6c47220984ea16fb3fae1aa62ba21f 100644 (file)
@@ -35,6 +35,8 @@ static int adt7316_i2c_read(void *client, u8 reg, u8 *data)
                return ret;
        }
 
+       *data = ret;
+
        return 0;
 }