diff options
author | Tomas Krcka <tomas.krcka@nkgroup.cz> | 2015-05-30 11:42:57 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-06-09 09:39:17 +0200 |
commit | 3d5db5e1310981ce7da570f7e686f3ff22c58b4b (patch) | |
tree | 068eb439ed97e8fb34bced59c1c8cbdb16891595 | |
parent | 941742f49762ba4c908510f036b09a46c1b14513 (diff) | |
download | linux-stable-3d5db5e1310981ce7da570f7e686f3ff22c58b4b.tar.gz linux-stable-3d5db5e1310981ce7da570f7e686f3ff22c58b4b.tar.bz2 linux-stable-3d5db5e1310981ce7da570f7e686f3ff22c58b4b.zip |
can: mcp251x: use correct register address for acceptance filters
This patch corrects addresses of acceptance filters. These registers are not in
use, but values should be correct. Tested with MCP2515 and am3352 and also
checked datasheets for MCP2515 and MCP2510.
Signed-off-by: Tomas Krcka <tomas.krcka@nkgroup.cz>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/spi/mcp251x.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index bf63fee4e743..c1a95a34d62e 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c @@ -190,10 +190,11 @@ #define RXBEID0_OFF 4 #define RXBDLC_OFF 5 #define RXBDAT_OFF 6 -#define RXFSIDH(n) ((n) * 4) -#define RXFSIDL(n) ((n) * 4 + 1) -#define RXFEID8(n) ((n) * 4 + 2) -#define RXFEID0(n) ((n) * 4 + 3) +#define RXFSID(n) ((n < 3) ? 0 : 4) +#define RXFSIDH(n) ((n) * 4 + RXFSID(n)) +#define RXFSIDL(n) ((n) * 4 + 1 + RXFSID(n)) +#define RXFEID8(n) ((n) * 4 + 2 + RXFSID(n)) +#define RXFEID0(n) ((n) * 4 + 3 + RXFSID(n)) #define RXMSIDH(n) ((n) * 4 + 0x20) #define RXMSIDL(n) ((n) * 4 + 0x21) #define RXMEID8(n) ((n) * 4 + 0x22) |