Commit 9118f08a authored by Mike Frysinger's avatar Mike Frysinger Committed by David S. Miller

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: default avatarMike Frysinger <vapier@gentoo.org>
Acked-by: default avatarWolfgang Grandegger <wg@grandegger.com>
Acked-by: default avatarKurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aca7a3ac
......@@ -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(&reg->chl[TRANSMIT_CHL].id0, id);
if (id & CAN_RTR_FLAG)
writew(((id & 0x1FFF0000) >> 16) | IDE | AME | RTR,
&reg->chl[TRANSMIT_CHL].id1);
else
writew(((id & 0x1FFF0000) >> 16) | IDE | AME,
&reg->chl[TRANSMIT_CHL].id1);
} else {
if (id & CAN_RTR_FLAG)
writew((id << 2) | AME | RTR,
&reg->chl[TRANSMIT_CHL].id1);
else
bfin_write16(&reg->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(&reg->chl[TRANSMIT_CHL].id1, val | AME);
/* fill payload */
for (i = 0; i < 8; i += 2) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment