Patchwork socket-can: bit-timing calculation

login
register
mail settings
Submitter Steven Miao
Date Jan. 16, 2012, 10:50 a.m.
Message ID <1326711025-6629-1-git-send-email-realmz6@gmail.com>
Download mbox | patch
Permalink /patch/136269/
State Awaiting Upstream
Delegated to: David Miller
Headers show

Comments

Steven Miao - Jan. 16, 2012, 10:50 a.m.
just use first found best bit rate prescaler

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

Patch

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) {