Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

Lee Jones 8a012ff9 cddc1141

+6 -2
+6 -2
drivers/mfd/twl4030-irq.c
··· 396 396 status = twl_i2c_read(sih->module, rxbuf, 397 397 sih->mask[line].isr_offset, sih->bytes_ixr); 398 398 if (status < 0) 399 - pr_err("twl4030: err %d initializing %s %s\n", 399 + pr_warn("twl4030: err %d initializing %s %s\n", 400 400 status, sih->name, "ISR"); 401 401 402 - if (!sih->set_cor) 402 + if (!sih->set_cor) { 403 403 status = twl_i2c_write(sih->module, buf, 404 404 sih->mask[line].isr_offset, 405 405 sih->bytes_ixr); 406 + if (status < 0) 407 + pr_warn("twl4030: write failed: %d\n", 408 + status); 409 + } 406 410 /* 407 411 * else COR=1 means read sufficed. 408 412 * (for most SIH modules...)