Commit ff9f4771 authored by Kumar Gala's avatar Kumar Gala Committed by Greg Kroah-Hartman

[PATCH] SPI: Renamed bitbang_transfer_setup to spi_bitbang_setup_transfer and export it

Renamed bitbang_transfer_setup to follow convention of other exported symbols
from spi-bitbang.  Exported spi_bitbang_setup_transfer to allow users of
spi-bitbang to use the function in their own setup_transfer.
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 025c3987
...@@ -138,8 +138,7 @@ static unsigned bitbang_txrx_32( ...@@ -138,8 +138,7 @@ static unsigned bitbang_txrx_32(
return t->len - count; return t->len - count;
} }
static int int spi_bitbang_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
bitbang_transfer_setup(struct spi_device *spi, struct spi_transfer *t)
{ {
struct spi_bitbang_cs *cs = spi->controller_state; struct spi_bitbang_cs *cs = spi->controller_state;
u8 bits_per_word; u8 bits_per_word;
...@@ -174,6 +173,7 @@ bitbang_transfer_setup(struct spi_device *spi, struct spi_transfer *t) ...@@ -174,6 +173,7 @@ bitbang_transfer_setup(struct spi_device *spi, struct spi_transfer *t)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(spi_bitbang_setup_transfer);
/** /**
* spi_bitbang_setup - default setup for per-word I/O loops * spi_bitbang_setup - default setup for per-word I/O loops
...@@ -203,7 +203,7 @@ int spi_bitbang_setup(struct spi_device *spi) ...@@ -203,7 +203,7 @@ int spi_bitbang_setup(struct spi_device *spi)
if (!cs->txrx_word) if (!cs->txrx_word)
return -EINVAL; return -EINVAL;
retval = bitbang_transfer_setup(spi, NULL); retval = spi_bitbang_setup_transfer(spi, NULL);
if (retval < 0) if (retval < 0)
return retval; return retval;
...@@ -454,7 +454,9 @@ int spi_bitbang_start(struct spi_bitbang *bitbang) ...@@ -454,7 +454,9 @@ int spi_bitbang_start(struct spi_bitbang *bitbang)
bitbang->use_dma = 0; bitbang->use_dma = 0;
bitbang->txrx_bufs = spi_bitbang_bufs; bitbang->txrx_bufs = spi_bitbang_bufs;
if (!bitbang->master->setup) { if (!bitbang->master->setup) {
bitbang->setup_transfer = bitbang_transfer_setup; if (!bitbang->setup_transfer)
bitbang->setup_transfer =
spi_bitbang_setup_transfer;
bitbang->master->setup = spi_bitbang_setup; bitbang->master->setup = spi_bitbang_setup;
bitbang->master->cleanup = spi_bitbang_cleanup; bitbang->master->cleanup = spi_bitbang_cleanup;
} }
......
...@@ -57,6 +57,8 @@ struct spi_bitbang { ...@@ -57,6 +57,8 @@ struct spi_bitbang {
extern int spi_bitbang_setup(struct spi_device *spi); extern int spi_bitbang_setup(struct spi_device *spi);
extern void spi_bitbang_cleanup(const struct spi_device *spi); extern void spi_bitbang_cleanup(const struct spi_device *spi);
extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
extern int spi_bitbang_setup_transfer(struct spi_device *spi,
struct spi_transfer *t);
/* start or stop queue processing */ /* start or stop queue processing */
extern int spi_bitbang_start(struct spi_bitbang *spi); extern int spi_bitbang_start(struct spi_bitbang *spi);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment