Skip to content

Commit

Permalink
drivers/misc/ad525x_dpot.c: fix typo in spi write16 and write24 trans…
Browse files Browse the repository at this point in the history
…fer counts

This is a bug fix.  Some SPI connected devices using 16/24 bit accesses,
previously failed, now work.

This typo slipped in after testing, during some restructuring.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Chris Verges <chrisv@cyberswitching.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Michael Hennerich authored and Linus Torvalds committed Oct 26, 2010
1 parent 6915e04 commit 1f9fa52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/ad525x_dpot-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ static int write8(void *client, u8 val)
static int write16(void *client, u8 reg, u8 val)
{
u8 data[2] = {reg, val};
return spi_write(client, data, 1);
return spi_write(client, data, 2);
}

static int write24(void *client, u8 reg, u16 val)
{
u8 data[3] = {reg, val >> 8, val};
return spi_write(client, data, 1);
return spi_write(client, data, 3);
}

static int read8(void *client)
Expand Down

0 comments on commit 1f9fa52

Please sign in to comment.