Skip to content

Commit

Permalink
W1: ds2490.c ds_write_bit, grouping error, disable readback
Browse files Browse the repository at this point in the history
ds_write_bit doesn't read the input buffer, so add COMM_ICP and a comment
that it will no longer generate a read back data byte.  If there is an
extra data byte later on then it will cause an error and discard what data
was there.  Corrected operator ordering for ds_send_control.

Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Fries authored and Linus Torvalds committed Oct 16, 2008
1 parent 1f4ec2d commit e1c86d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/w1/masters/ds2490.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,12 @@ static int ds_write_bit(struct ds_device *dev, u8 bit)
int err;
struct ds_status st;

err = ds_send_control(dev, COMM_BIT_IO | COMM_IM | (bit) ? COMM_D : 0, 0);
/* Set COMM_ICP to write without a readback. Note, this will
* produce one time slot, a down followed by an up with COMM_D
* only determing the timing.
*/
err = ds_send_control(dev, COMM_BIT_IO | COMM_IM | COMM_ICP |
(bit ? COMM_D : 0), 0);
if (err)
return err;

Expand Down

0 comments on commit e1c86d2

Please sign in to comment.