diff options
Diffstat (limited to 'drivers/spi/spi_s3c24xx.c')
-rw-r--r-- | drivers/spi/spi_s3c24xx.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 18a4c7f54380..e0d44af4745a 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -146,19 +146,10 @@ static int s3c24xx_spi_setupxfer(struct spi_device *spi, | |||
146 | return 0; | 146 | return 0; |
147 | } | 147 | } |
148 | 148 | ||
149 | /* the spi->mode bits understood by this driver: */ | ||
150 | #define MODEBITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH) | ||
151 | |||
152 | static int s3c24xx_spi_setup(struct spi_device *spi) | 149 | static int s3c24xx_spi_setup(struct spi_device *spi) |
153 | { | 150 | { |
154 | int ret; | 151 | int ret; |
155 | 152 | ||
156 | if (spi->mode & ~MODEBITS) { | ||
157 | dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n", | ||
158 | spi->mode & ~MODEBITS); | ||
159 | return -EINVAL; | ||
160 | } | ||
161 | |||
162 | ret = s3c24xx_spi_setupxfer(spi, NULL); | 153 | ret = s3c24xx_spi_setupxfer(spi, NULL); |
163 | if (ret < 0) { | 154 | if (ret < 0) { |
164 | dev_err(&spi->dev, "setupxfer returned %d\n", ret); | 155 | dev_err(&spi->dev, "setupxfer returned %d\n", ret); |
@@ -283,6 +274,9 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) | |||
283 | 274 | ||
284 | /* setup the master state. */ | 275 | /* setup the master state. */ |
285 | 276 | ||
277 | /* the spi->mode bits understood by this driver: */ | ||
278 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; | ||
279 | |||
286 | master->num_chipselect = hw->pdata->num_cs; | 280 | master->num_chipselect = hw->pdata->num_cs; |
287 | master->bus_num = pdata->bus_num; | 281 | master->bus_num = pdata->bus_num; |
288 | 282 | ||