[alsa-devel] [PATCH 2/2] ASoC: Use spi_write() for SPI writes

Lars-Peter Clausen lars at metafoo.de
Wed May 11 19:16:04 CEST 2011


On 05/11/2011 04:53 AM, Mark Brown wrote:
> do_spi_write() is just an open coded copy of do_spi_write() so we can
> delete it and just call spi_write() directly.  Indeed, as a result of
> recent refactoring all the SPI write functions are just very long
> wrappers around spi_write() which don't add anything except for some
> pointless copies so we can just use spi_write() as the hw_write
> operation directly.

This won't work. spi_write returns 0 or an error, but the snd_soc_cache
framework expects the hw_write callback to return the number of bytes transferred.
We need to keep do_spi_write to get i2c_transfer like semantics for the return
value.
The two patches[1] I send last weekm which do basically the same as your patch,
but keep do_spi_write, work fine though.

- Lars

[1]
http://mailman.alsa-project.org/pipermail/alsa-devel/2011-May/039467.html
http://mailman.alsa-project.org/pipermail/alsa-devel/2011-May/039468.html


More information about the Alsa-devel mailing list