aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/mpc52xx_psc_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/mpc52xx_psc_spi.c')
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 68c77a911595..bdae9f908978 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -261,9 +261,6 @@ static void mpc52xx_psc_spi_work(struct work_struct *work)
261 spin_unlock_irq(&mps->lock); 261 spin_unlock_irq(&mps->lock);
262} 262}
263 263
264/* the spi->mode bits understood by this driver: */
265#define MODEBITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST)
266
267static int mpc52xx_psc_spi_setup(struct spi_device *spi) 264static int mpc52xx_psc_spi_setup(struct spi_device *spi)
268{ 265{
269 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); 266 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);
@@ -273,12 +270,6 @@ static int mpc52xx_psc_spi_setup(struct spi_device *spi)
273 if (spi->bits_per_word%8) 270 if (spi->bits_per_word%8)
274 return -EINVAL; 271 return -EINVAL;
275 272
276 if (spi->mode & ~MODEBITS) {
277 dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
278 spi->mode & ~MODEBITS);
279 return -EINVAL;
280 }
281
282 if (!cs) { 273 if (!cs) {
283 cs = kzalloc(sizeof *cs, GFP_KERNEL); 274 cs = kzalloc(sizeof *cs, GFP_KERNEL);
284 if (!cs) 275 if (!cs)
@@ -385,6 +376,9 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
385 dev_set_drvdata(dev, master); 376 dev_set_drvdata(dev, master);
386 mps = spi_master_get_devdata(master); 377 mps = spi_master_get_devdata(master);
387 378
379 /* the spi->mode bits understood by this driver: */
380 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
381
388 mps->irq = irq; 382 mps->irq = irq;
389 if (pdata == NULL) { 383 if (pdata == NULL) {
390 dev_warn(dev, "probe called without platform data, no " 384 dev_warn(dev, "probe called without platform data, no "