mfd: twl4030-irq: Check return value from twl_i2c_write() - warn() on failure
authorLee Jones <lee.jones@linaro.org>
Mon, 18 Aug 2014 15:03:14 +0000 (16:03 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 26 Sep 2014 07:15:34 +0000 (08:15 +0100)
In the original code a return value variable was provided, but it
was never checked and the user was never informed of failure.  Now
it is and they are.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/twl4030-irq.c

index b1dabba763cf55f5009f62cd63be7663d6fd7271..1b772ef761cbf63cf1af01a32f9d720258214669 100644 (file)
@@ -396,13 +396,17 @@ static int twl4030_init_sih_modules(unsigned line)
                        status = twl_i2c_read(sih->module, rxbuf,
                                sih->mask[line].isr_offset, sih->bytes_ixr);
                        if (status < 0)
-                               pr_err("twl4030: err %d initializing %s %s\n",
+                               pr_warn("twl4030: err %d initializing %s %s\n",
                                        status, sih->name, "ISR");
 
-                       if (!sih->set_cor)
+                       if (!sih->set_cor) {
                                status = twl_i2c_write(sih->module, buf,
                                        sih->mask[line].isr_offset,
                                        sih->bytes_ixr);
+                               if (status < 0)
+                                       pr_warn("twl4030: write failed: %d\n",
+                                               status);
+                       }
                        /*
                         * else COR=1 means read sufficed.
                         * (for most SIH modules...)