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

can: kvaser_pciefd: Store the different firmware version components in a struct

Store firmware version in kvaser_pciefd_fw_version struct, specifying the
different components of the version number.
And drop debug prinout of firmware version, since later patches will expose
it via the devlink interface.

Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Link: https://patch.msgid.link/20250725123230.8-5-extja@kvaser.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Jimmy Assarsson and committed by
Marc Kleine-Budde
5131f18f 69a2cb63

+11 -6
+11 -6
drivers/net/can/kvaser_pciefd.c
··· 325 325 const struct kvaser_pciefd_dev_ops *ops; 326 326 }; 327 327 328 + struct kvaser_pciefd_fw_version { 329 + u8 major; 330 + u8 minor; 331 + u16 build; 332 + }; 333 + 328 334 static const struct kvaser_pciefd_address_offset kvaser_pciefd_altera_address_offset = { 329 335 .serdes = 0x1000, 330 336 .pci_ien = 0x50, ··· 443 437 u32 bus_freq; 444 438 u32 freq; 445 439 u32 freq_to_ticks_div; 440 + struct kvaser_pciefd_fw_version fw_version; 446 441 }; 447 442 448 443 struct kvaser_pciefd_rx_packet { ··· 1212 1205 u32 version, srb_status, build; 1213 1206 1214 1207 version = ioread32(KVASER_PCIEFD_SYSID_ADDR(pcie) + KVASER_PCIEFD_SYSID_VERSION_REG); 1208 + build = ioread32(KVASER_PCIEFD_SYSID_ADDR(pcie) + KVASER_PCIEFD_SYSID_BUILD_REG); 1215 1209 pcie->nr_channels = min(KVASER_PCIEFD_MAX_CAN_CHANNELS, 1216 1210 FIELD_GET(KVASER_PCIEFD_SYSID_VERSION_NR_CHAN_MASK, version)); 1217 - 1218 - build = ioread32(KVASER_PCIEFD_SYSID_ADDR(pcie) + KVASER_PCIEFD_SYSID_BUILD_REG); 1219 - dev_dbg(&pcie->pci->dev, "Version %lu.%lu.%lu\n", 1220 - FIELD_GET(KVASER_PCIEFD_SYSID_VERSION_MAJOR_MASK, version), 1221 - FIELD_GET(KVASER_PCIEFD_SYSID_VERSION_MINOR_MASK, version), 1222 - FIELD_GET(KVASER_PCIEFD_SYSID_BUILD_SEQ_MASK, build)); 1211 + pcie->fw_version.major = FIELD_GET(KVASER_PCIEFD_SYSID_VERSION_MAJOR_MASK, version); 1212 + pcie->fw_version.minor = FIELD_GET(KVASER_PCIEFD_SYSID_VERSION_MINOR_MASK, version); 1213 + pcie->fw_version.build = FIELD_GET(KVASER_PCIEFD_SYSID_BUILD_SEQ_MASK, build); 1223 1214 1224 1215 srb_status = ioread32(KVASER_PCIEFD_SRB_ADDR(pcie) + KVASER_PCIEFD_SRB_STAT_REG); 1225 1216 if (!(srb_status & KVASER_PCIEFD_SRB_STAT_DMA)) {