summaryrefslogtreecommitdiff
path: root/drivers/mfd/twl6030-irq.c
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2013-07-25 16:15:48 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2013-08-20 10:19:10 +0200
commita820e5686f5f048494f71a394edb55f1c24603c5 (patch)
tree34f6604d18d9e0c74d25485c4ee866da9bbea4a0 /drivers/mfd/twl6030-irq.c
parent87343e534117c2932adfb394351dc83d7c378af6 (diff)
downloadlinux-a820e5686f5f048494f71a394edb55f1c24603c5.tar.gz
mfd: twl6030-irq: Add error check when IRQs are masked initially
Add a missed check for errors when TWL IRQs are masked initially on probe and report an error in case of failure. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl6030-irq.c')
-rw-r--r--drivers/mfd/twl6030-irq.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
index 1606cedbbff4..f7da2614de80 100644
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -313,7 +313,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
struct device_node *node = dev->of_node;
int nr_irqs, irq_base, irq_end;
static struct irq_chip twl6030_irq_chip;
- int status = 0;
+ int status;
int i;
u8 mask[3];
@@ -335,11 +335,16 @@ int twl6030_init_irq(struct device *dev, int irq_num)
mask[2] = 0xFF;
/* mask all int lines */
- twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
+ status = twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
/* mask all int sts */
- twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
+ status |= twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
/* clear INT_STS_A,B,C */
- twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
+ status |= twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
+
+ if (status < 0) {
+ dev_err(dev, "I2C err writing TWL_MODULE_PIH: %d\n", status);
+ return status;
+ }
twl6030_irq_base = irq_base;