diff options
Diffstat (limited to 'drivers/staging/kpc2000/kpc2000_spi.c')
-rw-r--r-- | drivers/staging/kpc2000/kpc2000_spi.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 3be33c450cab..8becf972af9c 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -50,6 +50,7 @@ static struct flash_platform_data p2kr0_spi0_pdata = { .nr_parts = ARRAY_SIZE(p2kr0_spi0_parts), .parts = p2kr0_spi0_parts, }; + static struct flash_platform_data p2kr0_spi1_pdata = { .name = "SPI1", .nr_parts = ARRAY_SIZE(p2kr0_spi1_parts), @@ -162,14 +163,12 @@ union kp_spi_ffctrl { kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx) { u64 __iomem *addr = cs->base; - u64 val; addr += idx; if ((idx == KP_SPI_REG_CONFIG) && (cs->conf_cache >= 0)) return cs->conf_cache; - val = readq(addr); - return val; + return readq(addr); } static inline void @@ -227,8 +226,7 @@ kp_spi_txrx_pio(struct spi_device *spidev, struct spi_transfer *transfer) kp_spi_write_reg(cs, KP_SPI_REG_TXDATA, val); processed++; } - } - else if (rx) { + } else if (rx) { for (i = 0 ; i < c ; i++) { char test = 0; @@ -315,19 +313,19 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) if (transfer->speed_hz > KP_SPI_CLK || (len && !(rx_buf || tx_buf))) { dev_dbg(kpspi->dev, " transfer: %d Hz, %d %s%s, %d bpw\n", - transfer->speed_hz, - len, - tx_buf ? "tx" : "", - rx_buf ? "rx" : "", - transfer->bits_per_word); + transfer->speed_hz, + len, + tx_buf ? "tx" : "", + rx_buf ? "rx" : "", + transfer->bits_per_word); dev_dbg(kpspi->dev, " transfer -EINVAL\n"); return -EINVAL; } if (transfer->speed_hz && transfer->speed_hz < (KP_SPI_CLK >> 15)) { dev_dbg(kpspi->dev, "speed_hz %d below minimum %d Hz\n", - transfer->speed_hz, - KP_SPI_CLK >> 15); + transfer->speed_hz, + KP_SPI_CLK >> 15); dev_dbg(kpspi->dev, " speed_hz -EINVAL\n"); return -EINVAL; } @@ -478,7 +476,7 @@ kp_spi_probe(struct platform_device *pldev) /* register the slave boards */ #define NEW_SPI_DEVICE_FROM_BOARD_INFO_TABLE(table) \ for (i = 0 ; i < ARRAY_SIZE(table) ; i++) { \ - spi_new_device(master, &(table[i])); \ + spi_new_device(master, &table[i]); \ } switch ((drvdata->card_id & 0xFFFF0000) >> 16) { |