misc: apds9802als: Fix the logic checking timeout in als_wait_for_data_ready()
authorAxel Lin <axel.lin@ingics.com>
Fri, 16 Nov 2012 09:17:50 +0000 (17:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Nov 2012 12:53:08 +0000 (04:53 -0800)
In the case of timeout waiting for data ready, the retry variable is -1.
This also fixes a bug: current code returns -ETIMEDOUT if latest retry success
( which means retry is 0 when exiting the while loop ).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

No differences found