Commit 31804f63 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown

spi: omap-100k: fix spacing coding style issue

Fix the following checkpatch issues.

  ERROR: space prohibited after that open parenthesis '('
  ERROR: space required before the open parenthesis '('
  ERROR: trailing statements should be on next line
  ERROR: space required after that ',' (ctx:VxV)
  ERROR: spaces required around that '-=' (ctx:VxV)
  WARNING: sizeof *cs should be sizeof(*cs)
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 79c2f49a
...@@ -128,7 +128,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data) ...@@ -128,7 +128,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data)
} }
spi100k_enable_clock(master); spi100k_enable_clock(master);
writew( data , spi100k->base + SPI_TX_MSB); writew(data , spi100k->base + SPI_TX_MSB);
writew(SPI_CTRL_SEN(0) | writew(SPI_CTRL_SEN(0) |
SPI_CTRL_WORD_SIZE(len) | SPI_CTRL_WORD_SIZE(len) |
...@@ -136,7 +136,8 @@ static void spi100k_write_data(struct spi_master *master, int len, int data) ...@@ -136,7 +136,8 @@ static void spi100k_write_data(struct spi_master *master, int len, int data)
spi100k->base + SPI_CTRL); spi100k->base + SPI_CTRL);
/* Wait for bit ack send change */ /* Wait for bit ack send change */
while((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_WE) != SPI_STATUS_WE); while ((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_WE) != SPI_STATUS_WE)
;
udelay(1000); udelay(1000);
spi100k_disable_clock(master); spi100k_disable_clock(master);
...@@ -144,7 +145,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data) ...@@ -144,7 +145,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data)
static int spi100k_read_data(struct spi_master *master, int len) static int spi100k_read_data(struct spi_master *master, int len)
{ {
int dataH,dataL; int dataH, dataL;
struct omap1_spi100k *spi100k = spi_master_get_devdata(master); struct omap1_spi100k *spi100k = spi_master_get_devdata(master);
/* Always do at least 16 bits */ /* Always do at least 16 bits */
...@@ -157,7 +158,8 @@ static int spi100k_read_data(struct spi_master *master, int len) ...@@ -157,7 +158,8 @@ static int spi100k_read_data(struct spi_master *master, int len)
SPI_CTRL_RD, SPI_CTRL_RD,
spi100k->base + SPI_CTRL); spi100k->base + SPI_CTRL);
while((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_RD) != SPI_STATUS_RD); while ((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_RD) != SPI_STATUS_RD)
;
udelay(1000); udelay(1000);
dataL = readw(spi100k->base + SPI_RX_LSB); dataL = readw(spi100k->base + SPI_RX_LSB);
...@@ -208,12 +210,12 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) ...@@ -208,12 +210,12 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
rx = xfer->rx_buf; rx = xfer->rx_buf;
tx = xfer->tx_buf; tx = xfer->tx_buf;
do { do {
c-=1; c -= 1;
if (xfer->tx_buf != NULL) if (xfer->tx_buf != NULL)
spi100k_write_data(spi->master, word_len, *tx++); spi100k_write_data(spi->master, word_len, *tx++);
if (xfer->rx_buf != NULL) if (xfer->rx_buf != NULL)
*rx++ = spi100k_read_data(spi->master, word_len); *rx++ = spi100k_read_data(spi->master, word_len);
} while(c); } while (c);
} else if (word_len <= 16) { } else if (word_len <= 16) {
u16 *rx; u16 *rx;
const u16 *tx; const u16 *tx;
...@@ -221,12 +223,12 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) ...@@ -221,12 +223,12 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
rx = xfer->rx_buf; rx = xfer->rx_buf;
tx = xfer->tx_buf; tx = xfer->tx_buf;
do { do {
c-=2; c -= 2;
if (xfer->tx_buf != NULL) if (xfer->tx_buf != NULL)
spi100k_write_data(spi->master,word_len, *tx++); spi100k_write_data(spi->master, word_len, *tx++);
if (xfer->rx_buf != NULL) if (xfer->rx_buf != NULL)
*rx++ = spi100k_read_data(spi->master,word_len); *rx++ = spi100k_read_data(spi->master, word_len);
} while(c); } while (c);
} else if (word_len <= 32) { } else if (word_len <= 32) {
u32 *rx; u32 *rx;
const u32 *tx; const u32 *tx;
...@@ -234,12 +236,12 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) ...@@ -234,12 +236,12 @@ omap1_spi100k_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
rx = xfer->rx_buf; rx = xfer->rx_buf;
tx = xfer->tx_buf; tx = xfer->tx_buf;
do { do {
c-=4; c -= 4;
if (xfer->tx_buf != NULL) if (xfer->tx_buf != NULL)
spi100k_write_data(spi->master,word_len, *tx); spi100k_write_data(spi->master, word_len, *tx);
if (xfer->rx_buf != NULL) if (xfer->rx_buf != NULL)
*rx = spi100k_read_data(spi->master,word_len); *rx = spi100k_read_data(spi->master, word_len);
} while(c); } while (c);
} }
return count - c; return count - c;
} }
...@@ -281,7 +283,7 @@ static int omap1_spi100k_setup(struct spi_device *spi) ...@@ -281,7 +283,7 @@ static int omap1_spi100k_setup(struct spi_device *spi)
spi100k = spi_master_get_devdata(spi->master); spi100k = spi_master_get_devdata(spi->master);
if (!cs) { if (!cs) {
cs = kzalloc(sizeof *cs, GFP_KERNEL); cs = kzalloc(sizeof(*cs), GFP_KERNEL);
if (!cs) if (!cs)
return -ENOMEM; return -ENOMEM;
cs->base = spi100k->base + spi->chip_select * 0x14; cs->base = spi100k->base + spi->chip_select * 0x14;
...@@ -398,7 +400,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev) ...@@ -398,7 +400,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
if (!pdev->id) if (!pdev->id)
return -EINVAL; return -EINVAL;
master = spi_alloc_master(&pdev->dev, sizeof *spi100k); master = spi_alloc_master(&pdev->dev, sizeof(*spi100k));
if (master == NULL) { if (master == NULL) {
dev_dbg(&pdev->dev, "master allocation failed\n"); dev_dbg(&pdev->dev, "master allocation failed\n");
return -ENOMEM; return -ENOMEM;
......
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