diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2023-04-18 16:35:54 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2023-10-05 21:45:48 +0200 |
commit | bdfff1433cd6e2f47155f7bf205bcee32001a075 (patch) | |
tree | 15401562b9a2ac12c7065db2611b1b2cb583448d /drivers/net/can/at91_can.c | |
parent | 90aa9a250cf2def73e890177867155f6ce956912 (diff) | |
download | linux-bdfff1433cd6e2f47155f7bf205bcee32001a075.tar.gz linux-bdfff1433cd6e2f47155f7bf205bcee32001a075.tar.bz2 linux-bdfff1433cd6e2f47155f7bf205bcee32001a075.zip |
can: at91_can: MSR Register: convert to FIELD_PREP()
Use FIELD_PREP() to access the individual fields of the MSR register.
Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-8-9987d53600e0@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/at91_can.c')
-rw-r--r-- | drivers/net/can/at91_can.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index ec028fe833f0..41dd2ea239b9 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -83,6 +83,8 @@ enum at91_reg { #define AT91_MID_MIDVA_MASK GENMASK(28, 18) #define AT91_MID_MIDE BIT(29) +#define AT91_MSR_MTIMESTAMP_MASK GENMASK(15, 0) +#define AT91_MSR_MDLC_MASK GENMASK(19, 16) #define AT91_MSR_MRTR BIT(20) #define AT91_MSR_MABT BIT(22) #define AT91_MSR_MRDY BIT(23) @@ -599,7 +601,7 @@ static void at91_read_mb(struct net_device *dev, unsigned int mb, cf->can_id = FIELD_GET(AT91_MID_MIDVA_MASK, reg_mid); reg_msr = at91_read(priv, AT91_MSR(mb)); - cf->len = can_cc_dlc2len((reg_msr >> 16) & 0xf); + cf->len = can_cc_dlc2len(FIELD_GET(AT91_MSR_MDLC_MASK, reg_msr)); if (reg_msr & AT91_MSR_MRTR) { cf->can_id |= CAN_RTR_FLAG; |