diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-06-24 00:33:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-27 23:42:24 -0400 |
commit | 9118f08a7794e9a4908afbb0f9bc9455325a5631 (patch) | |
tree | c1294f851b788220d5a829ba8ed8afac1e69a610 | |
parent | aca7a3acb19a7a4b1084f6f2411f6eaf52dd79c0 (diff) |
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>
-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 b6e890d28366..dc6ef4a9e02a 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) | |||
243 | /* fill id */ | 243 | /* fill id */ |
244 | if (id & CAN_EFF_FLAG) { | 244 | if (id & CAN_EFF_FLAG) { |
245 | bfin_write16(®->chl[TRANSMIT_CHL].id0, id); | 245 | bfin_write16(®->chl[TRANSMIT_CHL].id0, id); |
246 | if (id & CAN_RTR_FLAG) | 246 | val = ((id & 0x1FFF0000) >> 16) | IDE; |
247 | writew(((id & 0x1FFF0000) >> 16) | IDE | AME | RTR, | 247 | } else |
248 | ®->chl[TRANSMIT_CHL].id1); | 248 | val = (id << 2); |
249 | else | 249 | if (id & CAN_RTR_FLAG) |
250 | writew(((id & 0x1FFF0000) >> 16) | IDE | AME, | 250 | val |= RTR; |
251 | ®->chl[TRANSMIT_CHL].id1); | 251 | bfin_write16(®->chl[TRANSMIT_CHL].id1, val | AME); |
252 | |||
253 | } else { | ||
254 | if (id & CAN_RTR_FLAG) | ||
255 | writew((id << 2) | AME | RTR, | ||
256 | ®->chl[TRANSMIT_CHL].id1); | ||
257 | else | ||
258 | bfin_write16(®->chl[TRANSMIT_CHL].id1, | ||
259 | (id << 2) | AME); | ||
260 | } | ||
261 | 252 | ||
262 | /* fill payload */ | 253 | /* fill payload */ |
263 | for (i = 0; i < 8; i += 2) { | 254 | for (i = 0; i < 8; i += 2) { |