]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy()
authorAlexander Sverdlin <alexander.sverdlin@nokia.com>
Tue, 9 Jun 2015 10:58:29 +0000 (12:58 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 10 Jun 2015 13:08:36 +0000 (22:08 +0900)
commitececc0a4238c196bf2d01b3d79c047643affe22b
tree260c4e159fc217c8c853b7e7c944dd598ec85d06
parenta4870e55bd95a07218afe2a8b39f15709a522cb8
i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy()

There are several problems in the function:
- "to_cnt" variable does nothing
- schedule_timeout() call without setting current state does nothing
- "allow_sleep" parameter is not really used

Refactor the function so that it really tries to wait. In case of timeout try
to recover the bus.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-davinci.c