aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi-xilinx.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index b16fccfe69bf..8c25c59df7b0 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -94,26 +94,6 @@ struct xilinx_spi {
94 void (*write_fn)(u32, void __iomem *); 94 void (*write_fn)(u32, void __iomem *);
95}; 95};
96 96
97static void xspi_write32(u32 val, void __iomem *addr)
98{
99 iowrite32(val, addr);
100}
101
102static unsigned int xspi_read32(void __iomem *addr)
103{
104 return ioread32(addr);
105}
106
107static void xspi_write32_be(u32 val, void __iomem *addr)
108{
109 iowrite32be(val, addr);
110}
111
112static unsigned int xspi_read32_be(void __iomem *addr)
113{
114 return ioread32be(addr);
115}
116
117static void xilinx_spi_tx(struct xilinx_spi *xspi) 97static void xilinx_spi_tx(struct xilinx_spi *xspi)
118{ 98{
119 if (!xspi->tx_ptr) { 99 if (!xspi->tx_ptr) {
@@ -398,15 +378,15 @@ static int xilinx_spi_probe(struct platform_device *pdev)
398 * Setup little endian helper functions first and try to use them 378 * Setup little endian helper functions first and try to use them
399 * and check if bit was correctly setup or not. 379 * and check if bit was correctly setup or not.
400 */ 380 */
401 xspi->read_fn = xspi_read32; 381 xspi->read_fn = ioread32;
402 xspi->write_fn = xspi_write32; 382 xspi->write_fn = iowrite32;
403 383
404 xspi->write_fn(XSPI_CR_LOOP, xspi->regs + XSPI_CR_OFFSET); 384 xspi->write_fn(XSPI_CR_LOOP, xspi->regs + XSPI_CR_OFFSET);
405 tmp = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET); 385 tmp = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET);
406 tmp &= XSPI_CR_LOOP; 386 tmp &= XSPI_CR_LOOP;
407 if (tmp != XSPI_CR_LOOP) { 387 if (tmp != XSPI_CR_LOOP) {
408 xspi->read_fn = xspi_read32_be; 388 xspi->read_fn = ioread32be;
409 xspi->write_fn = xspi_write32_be; 389 xspi->write_fn = iowrite32be;
410 } 390 }
411 391
412 master->bits_per_word_mask = SPI_BPW_MASK(bits_per_word); 392 master->bits_per_word_mask = SPI_BPW_MASK(bits_per_word);