Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

can: netlink: make can_tdc_changelink() FD agnostic

can_tdc_changelink() needs to access can_priv->fd making it
specific to CAN FD. Change the function parameter from struct can_priv
to struct data_bittiming_params. This way, the function becomes CAN FD
agnostic and can be reused later on for the CAN XL TDC.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250923-canxl-netlink-prep-v4-9-e720d28f66fe@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Vincent Mailhol and committed by
Marc Kleine-Budde
530c918f 2b0a6930

+6 -5
+6 -5
drivers/net/can/dev/netlink.c
··· 172 172 return 0; 173 173 } 174 174 175 - static int can_tdc_changelink(struct can_priv *priv, const struct nlattr *nla, 175 + static int can_tdc_changelink(struct data_bittiming_params *dbt_params, 176 + const struct nlattr *nla, 176 177 struct netlink_ext_ack *extack) 177 178 { 178 179 struct nlattr *tb_tdc[IFLA_CAN_TDC_MAX + 1]; 179 180 struct can_tdc tdc = { 0 }; 180 - const struct can_tdc_const *tdc_const = priv->fd.tdc_const; 181 + const struct can_tdc_const *tdc_const = dbt_params->tdc_const; 181 182 int err; 182 183 183 184 if (!tdc_const) ··· 216 215 tdc.tdcf = tdcf; 217 216 } 218 217 219 - priv->fd.tdc = tdc; 218 + dbt_params->tdc = tdc; 220 219 221 220 return 0; 222 221 } ··· 383 382 memset(&priv->fd.tdc, 0, sizeof(priv->fd.tdc)); 384 383 if (data[IFLA_CAN_TDC]) { 385 384 /* TDC parameters are provided: use them */ 386 - err = can_tdc_changelink(priv, data[IFLA_CAN_TDC], 387 - extack); 385 + err = can_tdc_changelink(&priv->fd, 386 + data[IFLA_CAN_TDC], extack); 388 387 if (err) { 389 388 priv->ctrlmode &= ~CAN_CTRLMODE_FD_TDC_MASK; 390 389 return err;