mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 06:24:17 +00:00
i2c: observe scl_count in i2c_deblock_gpio_loop()
When compiling with -Wtype-limits we see this error:
drivers/i2c/i2c-uclass.c: In function ‘i2c_deblock_gpio_loop’:
drivers/i2c/i2c-uclass.c:517:21: error: comparison of
unsigned expression >= 0 is always true [-Werror=type-limits]
517 | while (scl_count-- >= 0) {
|
Don't loop forever.
Fixes: 1f746a2c82
("i2c: Make deblock delay and SCL clock configurable")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
f6f9a01689
commit
da585c3c68
1 changed files with 1 additions and 1 deletions
|
@ -516,7 +516,7 @@ int i2c_deblock_gpio_loop(struct gpio_desc *sda_pin,
|
||||||
udelay(delay);
|
udelay(delay);
|
||||||
|
|
||||||
/* Toggle SCL until slave release SDA */
|
/* Toggle SCL until slave release SDA */
|
||||||
while (scl_count-- >= 0) {
|
for (; scl_count; --scl_count) {
|
||||||
i2c_gpio_set_pin(scl_pin, 1);
|
i2c_gpio_set_pin(scl_pin, 1);
|
||||||
udelay(delay);
|
udelay(delay);
|
||||||
i2c_gpio_set_pin(scl_pin, 0);
|
i2c_gpio_set_pin(scl_pin, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue