Staging: dt3155: fix wait_ibsyclr function
commit59200df52cf7d4bfb93aeb30289a8e9d2af3058d
authorH Hartley Sweeten <hartleys@visionengravers.com>
Wed, 14 Apr 2010 03:01:31 +0000 (13 22:01 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:35:36 +0000 (11 11:35 -0700)
tree51dc27a47f50b3b6aed118d1799301f873d715aa
parent09a3c4aeb108dcc2ee89370c511e263dbcc94563
Staging: dt3155: fix wait_ibsyclr function

The wait_ibsyclr function is supposed to return the status of the I2C
cycle.  Currently it will always return FALSE because the IIC_CSR2
register is not re-read in order to update the cached register value.
This results in the NEW_CYCLE bit still being 1.

The current code actually works correctly only because the return
value of {Read|Write}I2C is not checked in the driver.

Fix wait_ibsyclr by actually reading the IIC_CSR2 register to get the
updated status.  While here, change the return type to be an actual
errno instead of the private TRUE/FALSE define and remove the now
obvious comments about the return value.

Also, remove the local variable 'writestat' in WriteI2C and just
return the result of wait_ibsyclr.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/dt3155/dt3155_io.c