aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2014-09-23 05:18:11 -0400
committerMarc Kleine-Budde <mkl@pengutronix.de>2015-05-06 16:57:27 -0400
commit10d089bd4b289cbe08d2565f34e030c8980682f4 (patch)
tree446689e54c3477991c9c3f63e342645993c0586c
parent6f75fce1ea81b1d91f6f1a8e3dd00b0ce8e83982 (diff)
can: flexcan: replace open coded "mailbox code" by proper define
This patch replaces a open coded variant of a "mailbox code" definition by an existing define, improves code readability. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/net/can/flexcan.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 69333416d661..6201c5a1a884 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -158,7 +158,6 @@
158 FLEXCAN_IFLAG_BUF(FLEXCAN_TX_BUF_ID)) 158 FLEXCAN_IFLAG_BUF(FLEXCAN_TX_BUF_ID))
159 159
160/* FLEXCAN message buffers */ 160/* FLEXCAN message buffers */
161#define FLEXCAN_MB_CNT_CODE(x) (((x) & 0xf) << 24)
162#define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24) 161#define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24)
163#define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24) 162#define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24)
164#define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24) 163#define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24)
@@ -478,7 +477,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
478 struct flexcan_regs __iomem *regs = priv->base; 477 struct flexcan_regs __iomem *regs = priv->base;
479 struct can_frame *cf = (struct can_frame *)skb->data; 478 struct can_frame *cf = (struct can_frame *)skb->data;
480 u32 can_id; 479 u32 can_id;
481 u32 ctrl = FLEXCAN_MB_CNT_CODE(0xc) | (cf->can_dlc << 16); 480 u32 ctrl = FLEXCAN_MB_CODE_TX_DATA | (cf->can_dlc << 16);
482 481
483 if (can_dropped_invalid_skb(dev, skb)) 482 if (can_dropped_invalid_skb(dev, skb))
484 return NETDEV_TX_OK; 483 return NETDEV_TX_OK;