diff options
Diffstat (limited to 'drivers/spi/xilinx_spi.c')
-rw-r--r-- | drivers/spi/xilinx_spi.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 2d7e6b81fb4a..46b8c5c2f45e 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c | |||
@@ -158,9 +158,6 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, | |||
158 | return 0; | 158 | return 0; |
159 | } | 159 | } |
160 | 160 | ||
161 | /* the spi->mode bits understood by this driver: */ | ||
162 | #define MODEBITS (SPI_CPOL | SPI_CPHA) | ||
163 | |||
164 | static int xilinx_spi_setup(struct spi_device *spi) | 161 | static int xilinx_spi_setup(struct spi_device *spi) |
165 | { | 162 | { |
166 | struct spi_bitbang *bitbang; | 163 | struct spi_bitbang *bitbang; |
@@ -170,12 +167,6 @@ static int xilinx_spi_setup(struct spi_device *spi) | |||
170 | xspi = spi_master_get_devdata(spi->master); | 167 | xspi = spi_master_get_devdata(spi->master); |
171 | bitbang = &xspi->bitbang; | 168 | bitbang = &xspi->bitbang; |
172 | 169 | ||
173 | if (spi->mode & ~MODEBITS) { | ||
174 | dev_err(&spi->dev, "%s, unsupported mode bits %x\n", | ||
175 | __func__, spi->mode & ~MODEBITS); | ||
176 | return -EINVAL; | ||
177 | } | ||
178 | |||
179 | retval = xilinx_spi_setup_transfer(spi, NULL); | 170 | retval = xilinx_spi_setup_transfer(spi, NULL); |
180 | if (retval < 0) | 171 | if (retval < 0) |
181 | return retval; | 172 | return retval; |
@@ -327,6 +318,9 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev, | |||
327 | goto put_master; | 318 | goto put_master; |
328 | } | 319 | } |
329 | 320 | ||
321 | /* the spi->mode bits understood by this driver: */ | ||
322 | master->mode_bits = SPI_CPOL | SPI_CPHA; | ||
323 | |||
330 | xspi = spi_master_get_devdata(master); | 324 | xspi = spi_master_get_devdata(master); |
331 | xspi->bitbang.master = spi_master_get(master); | 325 | xspi->bitbang.master = spi_master_get(master); |
332 | xspi->bitbang.chipselect = xilinx_spi_chipselect; | 326 | xspi->bitbang.chipselect = xilinx_spi_chipselect; |