summaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/mcs7780.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-02-13 01:42:31 +0100
committerDavid S. Miller <davem@davemloft.net>2009-02-13 01:42:31 +0100
commitfb0886745a75ce98bde3aac421adc69fe61a1905 (patch)
tree8502cf2580bd427656156e4fe20e3fae9d7125ae /drivers/net/irda/mcs7780.c
parentnetxen: remove pcie workaround (diff)
downloadlinux-fb0886745a75ce98bde3aac421adc69fe61a1905.tar.xz
linux-fb0886745a75ce98bde3aac421adc69fe61a1905.zip
IRDA: cnt is off by 1
If no prior break occurs, cnt reaches 101 after the loop, so we are still able to change speed when cnt has become 100. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/mcs7780.c')
-rw-r--r--drivers/net/irda/mcs7780.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index 7eafdca19f34..85e88daab21a 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -585,7 +585,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
mcs_get_reg(mcs, MCS_RESV_REG, &rval);
} while(cnt++ < 100 && (rval & MCS_IRINTX));
- if(cnt >= 100) {
+ if (cnt > 100) {
IRDA_ERROR("unable to change speed\n");
ret = -EIO;
goto error;