projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
091438d
)
i2c-pxa.c: timeouts off by 1
author
Roel Kluin
<
[email protected]
>
Thu, 23 Apr 2009 14:27:39 +0000
(16:27 +0200)
committer
Ben Dooks
<
[email protected]
>
Sun, 3 May 2009 21:54:23 +0000
(22:54 +0100)
With `while (timeout--)' timeout reaches -1 after the loop, so the tests
below are off by one.
Signed-off-by: Roel Kluin <
[email protected]
>
Acked-by: Wolfram Sang <
[email protected]
>
Signed-off-by: Ben Dooks <
[email protected]
>
drivers/i2c/busses/i2c-pxa.c
patch
|
blob
|
history
diff --git
a/drivers/i2c/busses/i2c-pxa.c
b/drivers/i2c/busses/i2c-pxa.c
index c1405c8f6ba5645a163519a5d5cbbd7ac2021f6a..acc7143d96550b1e7880f5f03e13f828271546fa 100644
(file)
--- a/
drivers/i2c/busses/i2c-pxa.c
+++ b/
drivers/i2c/busses/i2c-pxa.c
@@
-265,10
+265,10
@@
static int i2c_pxa_wait_bus_not_busy(struct pxa_i2c *i2c)
show_state(i2c);
}
- if (timeout <
=
0)
+ if (timeout < 0)
show_state(i2c);
- return timeout <
=
0 ? I2C_RETRY : 0;
+ return timeout < 0 ? I2C_RETRY : 0;
}
static int i2c_pxa_wait_master(struct pxa_i2c *i2c)
@@
-612,7
+612,7
@@
static int i2c_pxa_pio_set_master(struct pxa_i2c *i2c)
show_state(i2c);
}
- if (timeout <
=
0) {
+ if (timeout < 0) {
show_state(i2c);
dev_err(&i2c->adap.dev,
"i2c_pxa: timeout waiting for bus free\n");