w1: slaves: ds2781: Return error when reset fails
authorGreg Meiste <w30289@motorola.com>
Mon, 1 Nov 2010 16:27:24 +0000 (11:27 -0500)
committerRebecca Schultz Zavin <rebecca@android.com>
Mon, 1 Nov 2010 21:35:21 +0000 (14:35 -0700)
The DS2781 one wire driver was returning success, even though the reset
had failed.  This covered up the issue where the DS2781 battery driver
was not reporting up up-to-date information.

Change-Id: Ie0c775ab900ed44ce12e798d62484b145c81d244
Signed-off-by: Greg Meiste <w30289@motorola.com>
drivers/w1/slaves/w1_ds2781.c

index cda90d7ddffcabb87804a22e8d363c0287b7bc59..b390085716dab651061ab9639bfe2a688e8f4b10 100644 (file)
@@ -55,6 +55,8 @@ static int w1_ds2781_io(struct device *dev, char *buf, int addr, size_t count,
                        w1_write_block(sl->master, buf, count);
                        /* XXX w1_write_block returns void, not n_written */
                }
+       } else {
+               count = 0;
        }
 
 out: