summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/pch_can.c
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2020-11-10 11:18:46 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2020-11-20 09:43:29 +0100
commit69d98969a0540039fc04e0f22bbe9f41b0a13d66 (patch)
treecaf7410d6dd6ec78a672734a095c754d2a540156 /drivers/net/can/pch_can.c
parentcan: add optional DLC element to Classical CAN frame structure (diff)
downloadlinux-69d98969a0540039fc04e0f22bbe9f41b0a13d66.tar.xz
linux-69d98969a0540039fc04e0f22bbe9f41b0a13d66.zip
can: rename get_can_dlc() macro with can_cc_dlc2len()
The get_can_dlc() macro is used to ensure the payload length information of the Classical CAN frame to be max 8 bytes (the CAN_MAX_DLEN). Rename the macro and use the correct constant in preparation of the len/dlc cleanup for Classical CAN frames. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/r/20201110101852.1973-3-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/pch_can.c')
-rw-r--r--drivers/net/can/pch_can.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 5c180d2f3c3c..9509bac8352d 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -683,7 +683,7 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 obj_num, int quota)
if (id2 & PCH_ID2_DIR)
cf->can_id |= CAN_RTR_FLAG;
- cf->can_dlc = get_can_dlc((ioread32(&priv->regs->
+ cf->can_dlc = can_cc_dlc2len((ioread32(&priv->regs->
ifregs[0].mcont)) & 0xF);
for (i = 0; i < cf->can_dlc; i += 2) {
@@ -715,7 +715,7 @@ static void pch_can_tx_complete(struct net_device *ndev, u32 int_stat)
iowrite32(PCH_CMASK_RX_TX_GET | PCH_CMASK_CLRINTPND,
&priv->regs->ifregs[1].cmask);
pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, int_stat);
- dlc = get_can_dlc(ioread32(&priv->regs->ifregs[1].mcont) &
+ dlc = can_cc_dlc2len(ioread32(&priv->regs->ifregs[1].mcont) &
PCH_IF_MCONT_DLC);
stats->tx_bytes += dlc;
stats->tx_packets++;