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)
commit44c54c4ec391412c7f529e53d27844dadc6d536a
treee47ed63c624262e9c572a62f400cde7893139814
parente11654ec22a3e00975a499fcfdbf0407e2d41b60
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