[PATCH] socket-can: bit-timing calculation

From: Steven Miao
Date: Mon Jan 16 2012 - 05:45:38 EST


just use first found best bit rate prescaler

Signed-off-by: Steven Miao <realmz6@xxxxxxxxx>
---
drivers/net/can/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 25695bd..9d4afe6 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -106,7 +106,7 @@ static int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt)
/* tseg brp biterror */
if (error < 0)
error = -error;
- if (error > best_error)
+ if (error >= best_error)
continue;
best_error = error;
if (error == 0) {
--
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/