diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-08-18 17:03:14 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-09-26 09:15:34 +0200 |
commit | 8a012ff9d8723fdf7ea242f0f41703eed7365b79 (patch) | |
tree | d881ea9fcaf85a5d2729ac3ddbf8afd1920c06d6 | |
parent | mfd: pcf50633: Check return value of platform_device_add() (diff) | |
download | linux-8a012ff9d8723fdf7ea242f0f41703eed7365b79.tar.xz linux-8a012ff9d8723fdf7ea242f0f41703eed7365b79.zip |
mfd: twl4030-irq: Check return value from twl_i2c_write() - warn() on failure
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>
-rw-r--r-- | drivers/mfd/twl4030-irq.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index b1dabba763cf..1b772ef761cb 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c @@ -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...) |