can: bittiming: rename can_tdc_is_enabled() into can_fd_tdc_is_enabled()
With the introduction of CAN XL, a new can_xl_tdc_is_enabled() helper function will be introduced later on. Rename can_tdc_is_enabled() into can_fd_tdc_is_enabled() to make it more explicit that this helper is meant for CAN FD. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://patch.msgid.link/20241112165118.586613-11-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
bee7e3322a
commit
23c0dc95bf
|
|
@ -144,7 +144,7 @@ static int can_tdc_changelink(struct can_priv *priv, const struct nlattr *nla,
|
|||
const struct can_tdc_const *tdc_const = priv->fd.tdc_const;
|
||||
int err;
|
||||
|
||||
if (!tdc_const || !can_tdc_is_enabled(priv))
|
||||
if (!tdc_const || !can_fd_tdc_is_enabled(priv))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
err = nla_parse_nested(tb_tdc, IFLA_CAN_TDC_MAX, nla,
|
||||
|
|
@ -409,7 +409,7 @@ static size_t can_tdc_get_size(const struct net_device *dev)
|
|||
size += nla_total_size(sizeof(u32)); /* IFLA_CAN_TDCF_MAX */
|
||||
}
|
||||
|
||||
if (can_tdc_is_enabled(priv)) {
|
||||
if (can_fd_tdc_is_enabled(priv)) {
|
||||
if (priv->ctrlmode & CAN_CTRLMODE_TDC_MANUAL ||
|
||||
priv->fd.do_get_auto_tdcv)
|
||||
size += nla_total_size(sizeof(u32)); /* IFLA_CAN_TDCV */
|
||||
|
|
@ -490,7 +490,7 @@ static int can_tdc_fill_info(struct sk_buff *skb, const struct net_device *dev)
|
|||
nla_put_u32(skb, IFLA_CAN_TDC_TDCF_MAX, tdc_const->tdcf_max)))
|
||||
goto err_cancel;
|
||||
|
||||
if (can_tdc_is_enabled(priv)) {
|
||||
if (can_fd_tdc_is_enabled(priv)) {
|
||||
u32 tdcv;
|
||||
int err = -EINVAL;
|
||||
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ static int es58x_fd_enable_channel(struct es58x_priv *priv)
|
|||
es58x_fd_convert_bittiming(&tx_conf_msg.data_bittiming,
|
||||
&priv->can.fd.data_bittiming);
|
||||
|
||||
if (can_tdc_is_enabled(&priv->can)) {
|
||||
if (can_fd_tdc_is_enabled(&priv->can)) {
|
||||
tx_conf_msg.tdc_enabled = 1;
|
||||
tx_conf_msg.tdco = cpu_to_le16(priv->can.fd.tdc.tdco);
|
||||
tx_conf_msg.tdcf = cpu_to_le16(priv->can.fd.tdc.tdcf);
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ static int xcan_set_bittiming(struct net_device *ndev)
|
|||
priv->devtype.cantype == XAXI_CANFD_2_0) {
|
||||
/* Setting Baud Rate prescaler value in F_BRPR Register */
|
||||
btr0 = dbt->brp - 1;
|
||||
if (can_tdc_is_enabled(&priv->can)) {
|
||||
if (can_fd_tdc_is_enabled(&priv->can)) {
|
||||
if (priv->devtype.cantype == XAXI_CANFD)
|
||||
btr0 |= FIELD_PREP(XCAN_BRPR_TDCO_MASK, priv->can.fd.tdc.tdco) |
|
||||
XCAN_BRPR_TDC_ENABLE;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ struct can_priv {
|
|||
struct can_berr_counter *bec);
|
||||
};
|
||||
|
||||
static inline bool can_tdc_is_enabled(const struct can_priv *priv)
|
||||
static inline bool can_fd_tdc_is_enabled(const struct can_priv *priv)
|
||||
{
|
||||
return !!(priv->ctrlmode & CAN_CTRLMODE_FD_TDC_MASK);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue