Commit c3358a74 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: bitbang: Convert unsigned to unsigned int

Simple type conversion with no functional change implied.
While at it, adjust indentation where it makes sense.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240517194104.747328-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f261172d
...@@ -43,21 +43,19 @@ typedef unsigned int (*spi_bb_txrx_bufs_fn)(struct spi_device *, spi_bb_txrx_wor ...@@ -43,21 +43,19 @@ typedef unsigned int (*spi_bb_txrx_bufs_fn)(struct spi_device *, spi_bb_txrx_wor
unsigned int); unsigned int);
struct spi_bitbang_cs { struct spi_bitbang_cs {
unsigned nsecs; /* (clock cycle time)/2 */ unsigned int nsecs; /* (clock cycle time) / 2 */
spi_bb_txrx_word_fn txrx_word; spi_bb_txrx_word_fn txrx_word;
spi_bb_txrx_bufs_fn txrx_bufs; spi_bb_txrx_bufs_fn txrx_bufs;
}; };
static unsigned bitbang_txrx_8( static unsigned int bitbang_txrx_8(struct spi_device *spi,
struct spi_device *spi,
spi_bb_txrx_word_fn txrx_word, spi_bb_txrx_word_fn txrx_word,
unsigned ns, unsigned int ns,
struct spi_transfer *t, struct spi_transfer *t,
unsigned flags unsigned int flags)
)
{ {
unsigned bits = t->bits_per_word; unsigned int bits = t->bits_per_word;
unsigned count = t->len; unsigned int count = t->len;
const u8 *tx = t->tx_buf; const u8 *tx = t->tx_buf;
u8 *rx = t->rx_buf; u8 *rx = t->rx_buf;
...@@ -74,16 +72,14 @@ static unsigned bitbang_txrx_8( ...@@ -74,16 +72,14 @@ static unsigned bitbang_txrx_8(
return t->len - count; return t->len - count;
} }
static unsigned bitbang_txrx_16( static unsigned int bitbang_txrx_16(struct spi_device *spi,
struct spi_device *spi,
spi_bb_txrx_word_fn txrx_word, spi_bb_txrx_word_fn txrx_word,
unsigned ns, unsigned int ns,
struct spi_transfer *t, struct spi_transfer *t,
unsigned flags unsigned int flags)
)
{ {
unsigned bits = t->bits_per_word; unsigned int bits = t->bits_per_word;
unsigned count = t->len; unsigned int count = t->len;
const u16 *tx = t->tx_buf; const u16 *tx = t->tx_buf;
u16 *rx = t->rx_buf; u16 *rx = t->rx_buf;
...@@ -100,16 +96,14 @@ static unsigned bitbang_txrx_16( ...@@ -100,16 +96,14 @@ static unsigned bitbang_txrx_16(
return t->len - count; return t->len - count;
} }
static unsigned bitbang_txrx_32( static unsigned int bitbang_txrx_32(struct spi_device *spi,
struct spi_device *spi,
spi_bb_txrx_word_fn txrx_word, spi_bb_txrx_word_fn txrx_word,
unsigned ns, unsigned int ns,
struct spi_transfer *t, struct spi_transfer *t,
unsigned flags unsigned int flags)
)
{ {
unsigned bits = t->bits_per_word; unsigned int bits = t->bits_per_word;
unsigned count = t->len; unsigned int count = t->len;
const u32 *tx = t->tx_buf; const u32 *tx = t->tx_buf;
u32 *rx = t->rx_buf; u32 *rx = t->rx_buf;
...@@ -221,7 +215,7 @@ EXPORT_SYMBOL_GPL(spi_bitbang_cleanup); ...@@ -221,7 +215,7 @@ EXPORT_SYMBOL_GPL(spi_bitbang_cleanup);
static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t) static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t)
{ {
struct spi_bitbang_cs *cs = spi->controller_state; struct spi_bitbang_cs *cs = spi->controller_state;
unsigned nsecs = cs->nsecs; unsigned int nsecs = cs->nsecs;
struct spi_bitbang *bitbang; struct spi_bitbang *bitbang;
bitbang = spi_controller_get_devdata(spi->controller); bitbang = spi_controller_get_devdata(spi->controller);
...@@ -234,7 +228,7 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t) ...@@ -234,7 +228,7 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t)
} }
if (spi->mode & SPI_3WIRE) { if (spi->mode & SPI_3WIRE) {
unsigned flags; unsigned int flags;
flags = t->tx_buf ? SPI_CONTROLLER_NO_RX : SPI_CONTROLLER_NO_TX; flags = t->tx_buf ? SPI_CONTROLLER_NO_RX : SPI_CONTROLLER_NO_TX;
return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, flags); return cs->txrx_bufs(spi, cs->txrx_word, nsecs, t, flags);
......
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