On Wed, Oct 21, 2020 at 10:10 PM Drew Fustini <drew@xxxxxxxxxxxxxxx> wrote: > > Hi Marc, thanks for working on mcp251xfd driver that has been pulled into 5.10. > > I would like to use it with the official rpi-5.4.y branch [1] which > currently ships on their Raspberry Pi OS image. The target board is a > Raspberry Pi 4 in 32-bit mode which uses bcm2711_defconfig [2] > according to their instructions [3]. > > I copied mcp251xfd from 5.10 and got this error when compiling: > =================================================== > AR drivers/net/can/spi/mcp251xfd/built-in.a > CC [M] drivers/net/can/spi/mcp251xfd/mcp251xfd-core.o > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c: In function > ‘mcp251xfd_tx_ring_init_tx_obj’: > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:314:23: error: request > for member ‘value’ in something not a structure or union > xfer->cs_change_delay.value = 0; > ^ > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:315:23: error: request > for member ‘unit’ in something not a structure or union > xfer->cs_change_delay.unit = SPI_DELAY_UNIT_NSECS; > ^ > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c: In function ‘mcp251xfd_probe’: > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:2862:2: error: implicit > declaration of function ‘can_rx_offload_add_manual’ > [-Werror=implicit-function-declaration] > err = can_rx_offload_add_manual(ndev, &priv->offload, > ^ > cc1: some warnings being treated as errors > make[5]: *** [scripts/Makefile.build:266: > drivers/net/can/spi/mcp251xfd/mcp251xfd-core.o] Error 1 > make[4]: *** [scripts/Makefile.build:500: drivers/net/can/spi/mcp251xfd] Error 2 > make[3]: *** [scripts/Makefile.build:500: drivers/net/can/spi] Error 2 > make[2]: *** [scripts/Makefile.build:500: drivers/net/can] Error 2 > make[1]: *** [scripts/Makefile.build:500: drivers/net] Error 2 > make: *** [Makefile:1732: drivers] Error 2 > =================================================== > > I believe this is a result of 329f0dac4cad ("spi: make > `cs_change_delay` the first user of the `spi_delay` logic") where > integer values `cs_change_delay` and `cs_change_delay_unit` are > replaced with `struct spi_delay`. > > I thought I would ask if you have any advice before I start making > incremental changes to get it to compile under 5.4. > > thank you, > drew > > [1] https://github.com/raspberrypi/linux/blob/rpi-5.4.y/ > [2] https://github.com/raspberrypi/linux/blob/rpi-5.4.y/arch/arm/configs/bcm2711_defconfig > [3] https://www.raspberrypi.org/documentation/linux/kernel/building.md It appears it was simpler to get it to compile than I expected. cs_change_delay.unit becomes cs_change_delay_unit, and cs_change_delay.value becomes cs_change_delay. The other issue was 728fc9ff73d3 ("can: rx-offload: can_rx_offload_add_manual(): add new initialization function") which was simply solved by adding can_rx_offload_add_manual() to: include/linux/can/rx-offload.h drivers/net/can/rx-offload.c The driver builds ok: filename: /home/pdp7/dev/rpi/linux/./drivers/net/can/spi/mcp251xfd/mcp251xfd.ko license: GPL v2 description: Microchip MCP251xFD Family CAN controller driver author: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> srcversion: 336E42AD62992352D5E583E alias: spi:mcp251xfd alias: spi:mcp2518fd alias: spi:mcp2517fd alias: of:N*T*Cmicrochip,mcp251xfdC* alias: of:N*T*Cmicrochip,mcp251xfd alias: of:N*T*Cmicrochip,mcp2518fdC* alias: of:N*T*Cmicrochip,mcp2518fd alias: of:N*T*Cmicrochip,mcp2517fdC* alias: of:N*T*Cmicrochip,mcp2517fd depends: can-dev intree: Y name: mcp251xfd vermagic: 5.4.72-v7l+ SMP mod_unload modversions ARMv7 p2v8 thanks, drew