]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: davinci: fixup wait_for_completion_timeout handling
authorNicholas Mc Guire <hofrat@osadl.org>
Tue, 17 Mar 2015 07:51:13 +0000 (03:51 -0400)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 27 Mar 2015 15:53:42 +0000 (16:53 +0100)
commit681329be7ab0be80ea75d14c58fd96fb0f874787
tree99773d332d038a1e01762d7163d83fbf6537322b
parentad559be0321bc1950d71abc456fac3df70aee1e1
i2c: davinci: fixup wait_for_completion_timeout handling

wait_for_completion_timeout return 0 (timeout) or >=1 (completion) so the check
for >= 0 is always true and can be dropped implying that r==-EREMOTEIO and thus
the return of -EREMOTEIO can be done in the   if (dev->buf_len)  branch.
As wait_for_completion_timeout returns unsigned long not int, and   int r   is
exclusively used for wait_for_completion_timeout it is renamed and the type
changed to unsigned long.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-davinci.c