aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--miscutils/i2c_tools.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index 7be489036..e19d851fe 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -732,8 +732,10 @@ static int read_block_data(int buf_fd, int mode, int *block)
732 tmp = i2c_smbus_read_i2c_block_data( 732 tmp = i2c_smbus_read_i2c_block_data(
733 buf_fd, res, I2C_SMBUS_BLOCK_MAX, 733 buf_fd, res, I2C_SMBUS_BLOCK_MAX,
734 cblock + res); 734 cblock + res);
735 if (tmp <= 0) 735 if (tmp <= 0) {
736 blen = tmp;
736 goto fail; 737 goto fail;
738 }
737 } 739 }
738 740
739 if (res >= I2CDUMP_NUM_REGS) 741 if (res >= I2CDUMP_NUM_REGS)
@@ -750,7 +752,7 @@ static int read_block_data(int buf_fd, int mode, int *block)
750 return blen; 752 return blen;
751 753
752 fail: 754 fail:
753 bb_error_msg_and_die("block read failed"); 755 bb_error_msg_and_die("block read failed: %d", blen);
754} 756}
755 757
756/* Dump all but word data. */ 758/* Dump all but word data. */