Message ID | 20210824104041.708945-1-tanureal@opensource.cirrus.com |
---|---|
Headers | show |
Series | Improve support for AMD SPI controllers | expand |
On Tue, Aug 24, 2021 at 11:40:33AM +0100, Lucas Tanure wrote: > + if (master->max_transfer_size) { > + bus = kmemdup(®map_spi, sizeof(*bus), GFP_KERNEL); We shouldn't be peering into the controller structure, use spi_max_transfer_size() instead. > + bus->max_raw_read = bus->max_raw_write = master->max_transfer_size(spi); Just write two assignment statements, it's more legible all round.
On Tue, Aug 24, 2021 at 11:40:39AM +0100, Lucas Tanure wrote: > Check if the bus is not in use before starting the transfer > Also wait after so the READ bytes in the FIFO are ready to > be copied This means that we will wait for read to be ready even for write only operations, as opposed to potentially just absorbing the delay while the CPU does other stuff. If we need to wait prior to reading we should do that in the relevant code.