]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
spi: Use void pointers for data in simple SPI I/O operations
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 May 2011 22:09:30 +0000 (00:09 +0200)
committerGrant Likely <grant.likely@secretlab.ca>
Fri, 20 May 2011 06:43:07 +0000 (00:43 -0600)
Currently the simple SPI I/O operations all take pointers to u8 * buffers
to operate on. This creates needless type compatibility issues and the
underlying spi_transfer structure uses void pointers anyway so convert the
API over to take void pointers too.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/spi.c
include/linux/spi/spi.h

index 82b9a428c323eab0a0ea2fa4d8f033ba67025ee5..2e13a14bba3fdd62a3ded1711de7dc75fe785dfc 100644 (file)
@@ -1047,8 +1047,8 @@ static u8 *buf;
  * spi_{async,sync}() calls with dma-safe buffers.
  */
 int spi_write_then_read(struct spi_device *spi,
-               const u8 *txbuf, unsigned n_tx,
-               u8 *rxbuf, unsigned n_rx)
+               const void *txbuf, unsigned n_tx,
+               void *rxbuf, unsigned n_rx)
 {
        static DEFINE_MUTEX(lock);
 
index b4d7710bc38d2b26effd6025243150490e0a26a9..bb4f5fbbbd8e8ba1cfcfaed6b99533ec8a68ca0e 100644 (file)
@@ -581,7 +581,7 @@ extern int spi_bus_unlock(struct spi_master *master);
  * Callable only from contexts that can sleep.
  */
 static inline int
-spi_write(struct spi_device *spi, const u8 *buf, size_t len)
+spi_write(struct spi_device *spi, const void *buf, size_t len)
 {
        struct spi_transfer     t = {
                        .tx_buf         = buf,
@@ -605,7 +605,7 @@ spi_write(struct spi_device *spi, const u8 *buf, size_t len)
  * Callable only from contexts that can sleep.
  */
 static inline int
-spi_read(struct spi_device *spi, u8 *buf, size_t len)
+spi_read(struct spi_device *spi, void *buf, size_t len)
 {
        struct spi_transfer     t = {
                        .rx_buf         = buf,
@@ -620,8 +620,8 @@ spi_read(struct spi_device *spi, u8 *buf, size_t len)
 
 /* this copies txbuf and rxbuf data; for small transfers only! */
 extern int spi_write_then_read(struct spi_device *spi,
-               const u8 *txbuf, unsigned n_tx,
-               u8 *rxbuf, unsigned n_rx);
+               const void *txbuf, unsigned n_tx,
+               void *rxbuf, unsigned n_rx);
 
 /**
  * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read