On Fri, May 15, 2020 at 05:58:02PM +0200, Lukas Wunner wrote: > Fix by using the non-devm variant spi_register_controller(). Note that > the struct spi_controller as well as the driver-private data are not > freed until after bcm2835_spi_remove() has finished, so accessing them > is safe. Why not use managed allocations of clocks and DMA channels? This is a standard issue with the devm APIs, if you're using them you basically need to use them for *everything* up to the point where you start using them.