From: Imre Deak Date: Mon, 20 Feb 2006 16:51:18 +0000 (+0200) Subject: ARM: OMAP: lcd_lph8923: fix register read / write X-Git-Tag: v2.6.16-omap1~57 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=abd2557cee2ffddc23c7af39b083e4880b1ea9d9;p=linux-2.6-omap-h63xx.git ARM: OMAP: lcd_lph8923: fix register read / write A local variable hiding the one with the same name at an upper scope, resulted in storing the register address instead of the desired value in LCD registers. In register writes there is no extra cycle after the command, so we use only 9-bit word size. Fix from Peter Ujfalusi . Signed-off-by: Imre Deak Signed-off-by: Juha Yrjölä --- diff --git a/drivers/video/omap/lcd_lph8923.c b/drivers/video/omap/lcd_lph8923.c index 64e1c54b9b3..69f5f184335 100644 --- a/drivers/video/omap/lcd_lph8923.c +++ b/drivers/video/omap/lcd_lph8923.c @@ -163,13 +163,7 @@ static void lph8923_write(int cmd, const u8 *buf, int len) spi_message_init(&m); m.spi = lph8923.spi; - - if (len > 1) { - cmd <<= 1; - set_spi_data_width(10); - } else { - set_spi_data_width(9); - } + set_spi_data_width(9); t.cs_change = 0; w = cmd; @@ -183,12 +177,8 @@ static void lph8923_write(int cmd, const u8 *buf, int len) if (!len) return; - set_spi_data_width(9); - t.tx_buf = &w; for (i = 0; i < len; i++) { - u16 w; - spi_message_init(&m); m.spi = lph8923.spi; spi_message_add_tail(&t, &m);