On Sat, Dec 10, 2022 at 06:48:02AM -0800, Max Filippov wrote:Ideally, spi_bitbang_stop() should undo spi_bitbang_start(). shall we move spi_master_put() in spi_bitbang_stop() instead of
Hi Christophe,Probably worth a comment though since it is a bit of a gotcha. Ideally
On Sat, Dec 10, 2022 at 3:52 AM Christophe JAILLET
<christophe.jaillet@xxxxxxxxxx> wrote:
'master' is allocated with devm_spi_alloc_master(), there is no need toThis put is matching the get in the spi_bitbang_start.
put it explicitly in the remove function.
spi_bitbang_stop(&xspi->bitbang);
- spi_master_put(master);
It was discussed here:
https://lore.kernel.org/linux-spi/CAMo8BfJaD7pG_iutY8jordysjChyzhTpVSqpxXh3QoZsj2QmaQ@xxxxxxxxxxxxxx/
we'd improve this in the bitbang code but that's harder.