From b92d85efbc2c09d8abcd70f9f070c67918593fde Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Tue, 7 Dec 2004 15:32:19 +0000 Subject: [PATCH] fix lm93_read_block which was retrying even on success. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2788 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 ++ kernel/chips/lm93.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 47378b18..c57050af 100644 --- a/CHANGES +++ b/CHANGES @@ -45,10 +45,12 @@ ask CVS about it: Adds a couple log messages for failed transactions (David Knierim) Fix compilation breaking C99-ism (Axel Thimm) + Fix block read retries Module pc87360: Support secondary Super-I/O address Module smsc47m1: Add support for 47M15x and 47M192 (fans only) Library: Add lm63 support Add lpc47b397 support + Programs *.init: Rename lockfile to match file name Programs i2cset, isaset: Written byte/word can be masked Program decode-vaio.pl: Find eeproms on non-0 i2c bus too Program mkpatch: Include i2c-amd756-s4882 diff --git a/kernel/chips/lm93.c b/kernel/chips/lm93.c index fc86b55f..a34a559a 100644 --- a/kernel/chips/lm93.c +++ b/kernel/chips/lm93.c @@ -444,13 +444,15 @@ static u8 lm93_block_buffer[I2C_SMBUS_BLOCK_MAX]; */ static void lm93_read_block(struct i2c_client *client, u8 fbn, u8 *values) { - int i, result; + int i, result=0; for (i = 1; i <= MAX_RETRIES; i++) { result = i2c_smbus_read_block_data(client, lm93_block_read_cmds[fbn].cmd, lm93_block_buffer); - if (result != lm93_block_read_cmds[fbn].len) { + if (result == lm93_block_read_cmds[fbn].len) { + break; + } else { printk(KERN_WARNING "lm93.o: block read data failed, " "command 0x%02x.\n", lm93_block_read_cmds[fbn].cmd);