]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: i801: Improve status polling
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 25 May 2021 19:59:05 +0000 (21:59 +0200)
committerWolfram Sang <wsa@kernel.org>
Sun, 20 Jun 2021 20:51:26 +0000 (22:51 +0200)
commit1f27cfe522d6cf5b928af772d0b9372bb3b1f75f
treee47ed63c624262e9c572a62f400cde7893139814
parent003da52cc071b64569eb98c2c4fb847be7991d2d
i2c: i801: Improve status polling

Polling uses the same timeout as irq mode: 400 * 500us = 200ms = HZ / 5.
So let's use the adapter->timeout value also for polling. This has the
advantage that userspace can control the timeout value for polling as
well. In addition change the code to make it better readable.
Last but not least remove the timeout debug messages. Calls to both
functions are followed by a call to i801_check_post() that will print
an error message in case of timeout.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-i801.c