aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorOleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>2012-02-29 14:14:18 +0200
committerZiyann <jaraidaniel@gmail.com>2014-10-01 13:00:30 +0200
commit4163a3595358cb772c9815200b82d9cb62b13a3a (patch)
treef4dc367fa04cddb5b597224ae748d87cbfc5dbc7 /drivers/mfd
parentee81c818acc7870e6781c3d4a235634b81022efb (diff)
downloadkernel_samsung_tuna-4163a3595358cb772c9815200b82d9cb62b13a3a.zip
kernel_samsung_tuna-4163a3595358cb772c9815200b82d9cb62b13a3a.tar.gz
kernel_samsung_tuna-4163a3595358cb772c9815200b82d9cb62b13a3a.tar.bz2
MFD: TWL6030_GPADC: Fix twl6030_gpadc_ioctl function
For the twl6032 was no possible to read channels 17 and 18 because for the twl6032 channel number was compared with TWL6030_GPADC_MAX_CHANNELS. This patch fix it. Change-Id: Ie3b96586d58d8938b6e46649735cb26fa43540cb Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl6030-gpadc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mfd/twl6030-gpadc.c b/drivers/mfd/twl6030-gpadc.c
index 629f33c..d80f27f 100644
--- a/drivers/mfd/twl6030-gpadc.c
+++ b/drivers/mfd/twl6030-gpadc.c
@@ -922,11 +922,13 @@ static long twl6030_gpadc_ioctl(struct file *filp, unsigned int cmd,
switch (cmd) {
case TWL6030_GPADC_IOCX_ADC_RAW_READ: {
struct twl6030_gpadc_request req;
- if ((the_gpadc->features & TWL6032_SUBCLASS)
- && (par.channel >= TWL6032_GPADC_MAX_CHANNELS))
- return -EINVAL;
- else if (par.channel >= TWL6030_GPADC_MAX_CHANNELS)
- return -EINVAL;
+ if (the_gpadc->features & TWL6032_SUBCLASS) {
+ if (par.channel >= TWL6032_GPADC_MAX_CHANNELS)
+ return -EINVAL;
+ } else {
+ if (par.channel >= TWL6030_GPADC_MAX_CHANNELS)
+ return -EINVAL;
+ }
req.channels = (1 << par.channel);
if (the_gpadc->features & TWL6032_SUBCLASS)