summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2010-10-21 18:39:26 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2011-06-06 11:00:10 +0200
commite14ee40bece891b5edccdd514112999ec423a448 (patch)
tree6188f15965c8d8ed7ad7f0b4463f026370ed441e
parent5613fff2dc315e5f44623031cb62a29942548427 (diff)
downloadlinux-3.10-e14ee40bece891b5edccdd514112999ec423a448.tar.gz
linux-3.10-e14ee40bece891b5edccdd514112999ec423a448.tar.bz2
linux-3.10-e14ee40bece891b5edccdd514112999ec423a448.zip
can: at91_can: don't copy data to rx'ed RTR frames
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
-rw-r--r--drivers/net/can/at91_can.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index afd0f5d394b..5358d705921 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -513,12 +513,14 @@ static void at91_read_mb(struct net_device *dev, unsigned int mb,
cf->can_id = (reg_mid >> 18) & CAN_SFF_MASK;
reg_msr = at91_read(priv, AT91_MSR(mb));
- if (reg_msr & AT91_MSR_MRTR)
- cf->can_id |= CAN_RTR_FLAG;
cf->can_dlc = get_can_dlc((reg_msr >> 16) & 0xf);
- *(u32 *)(cf->data + 0) = at91_read(priv, AT91_MDL(mb));
- *(u32 *)(cf->data + 4) = at91_read(priv, AT91_MDH(mb));
+ if (reg_msr & AT91_MSR_MRTR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else {
+ *(u32 *)(cf->data + 0) = at91_read(priv, AT91_MDL(mb));
+ *(u32 *)(cf->data + 4) = at91_read(priv, AT91_MDH(mb));
+ }
/* allow RX of extended frames */
at91_write(priv, AT91_MID(mb), AT91_MID_MIDE);