diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-06-24 04:33:01 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-27 20:42:24 -0700 |
commit | 9118f08a7794e9a4908afbb0f9bc9455325a5631 (patch) | |
tree | c1294f851b788220d5a829ba8ed8afac1e69a610 /drivers/net | |
parent | aca7a3acb19a7a4b1084f6f2411f6eaf52dd79c0 (diff) | |
download | op-kernel-dev-9118f08a7794e9a4908afbb0f9bc9455325a5631.zip op-kernel-dev-9118f08a7794e9a4908afbb0f9bc9455325a5631.tar.gz |
can: bfin_can: simplify xmit id1 setup
If we look closely, the 4 writes to TRANSMIT_CHL.id1 can be collapsed
down into much simpler code. So do just that.
This also fixes a build failure due to the I/O macros no longer
getting pulled in. Their minor (and accidental) usage here gets
dropped as part of the unification.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/bfin_can.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c index b6e890d..dc6ef4a 100644 --- a/drivers/net/can/bfin_can.c +++ b/drivers/net/can/bfin_can.c @@ -243,21 +243,12 @@ static int bfin_can_start_xmit(struct sk_buff *skb, struct net_device *dev) /* fill id */ if (id & CAN_EFF_FLAG) { bfin_write16(®->chl[TRANSMIT_CHL].id0, id); - if (id & CAN_RTR_FLAG) - writew(((id & 0x1FFF0000) >> 16) | IDE | AME | RTR, - ®->chl[TRANSMIT_CHL].id1); - else - writew(((id & 0x1FFF0000) >> 16) | IDE | AME, - ®->chl[TRANSMIT_CHL].id1); - - } else { - if (id & CAN_RTR_FLAG) - writew((id << 2) | AME | RTR, - ®->chl[TRANSMIT_CHL].id1); - else - bfin_write16(®->chl[TRANSMIT_CHL].id1, - (id << 2) | AME); - } + val = ((id & 0x1FFF0000) >> 16) | IDE; + } else + val = (id << 2); + if (id & CAN_RTR_FLAG) + val |= RTR; + bfin_write16(®->chl[TRANSMIT_CHL].id1, val | AME); /* fill payload */ for (i = 0; i < 8; i += 2) { |