summaryrefslogtreecommitdiffstats
path: root/drivers/spi/xilinx_spi.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-10-14 08:54:55 -0600
committerGrant Likely <grant.likely@secretlab.ca>2010-11-09 21:41:27 -0700
commit91565c4068042b3d8e37e64e393ca105476419bd (patch)
tree3281cb89e60641766c8cfe94ebf4fbe47baa54f0 /drivers/spi/xilinx_spi.c
parentf6614b7bb405a9b35dd28baea989a749492c46b2 (diff)
downloadlinux-91565c4068042b3d8e37e64e393ca105476419bd.tar.gz
linux-91565c4068042b3d8e37e64e393ca105476419bd.tar.bz2
linux-91565c4068042b3d8e37e64e393ca105476419bd.zip
spi/xilinx: Eliminate pdata references from common code.
The current code has the OF binding modifying the platform_data pointer which it must not do, and the common code doesn't really need to use a pdata pointer. This patch eliminates the platform_data references from the common part of the driver in preparation for merging the OF and non-OF versions. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'drivers/spi/xilinx_spi.c')
-rw-r--r--drivers/spi/xilinx_spi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 80f2db5bcfd6..efb28ba4a4ec 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -351,18 +351,12 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id)
}
struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem,
- u32 irq, s16 bus_num)
+ u32 irq, s16 bus_num, int num_cs, int little_endian, int bits_per_word)
{
struct spi_master *master;
struct xilinx_spi *xspi;
- struct xspi_platform_data *pdata = dev->platform_data;
int ret;
- if (!pdata) {
- dev_err(dev, "No platform data attached\n");
- return NULL;
- }
-
master = spi_alloc_master(dev, sizeof(struct xilinx_spi));
if (!master)
return NULL;
@@ -389,21 +383,21 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem,
}
master->bus_num = bus_num;
- master->num_chipselect = pdata->num_chipselect;
+ master->num_chipselect = num_cs;
#ifdef CONFIG_OF
master->dev.of_node = dev->of_node;
#endif
xspi->mem = *mem;
xspi->irq = irq;
- if (pdata->little_endian) {
+ if (little_endian) {
xspi->read_fn = xspi_read32;
xspi->write_fn = xspi_write32;
} else {
xspi->read_fn = xspi_read32_be;
xspi->write_fn = xspi_write32_be;
}
- xspi->bits_per_word = pdata->bits_per_word;
+ xspi->bits_per_word = bits_per_word;
if (xspi->bits_per_word == 8) {
xspi->tx_fn = xspi_tx8;
xspi->rx_fn = xspi_rx8;