From: Axel Lin Date: Fri, 28 Mar 2014 15:37:54 +0000 (+0800) Subject: spi: mpc52xx: Convert to use bits_per_word_mask X-Git-Tag: MMI-PSA29.97-13-9~12508^2~4^5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5c5989ccd32c37890115a6dd5c03f39cba7f7beb;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git spi: mpc52xx: Convert to use bits_per_word_mask This controller only supports 8-bit word length. Set bits_per_word_mask so spi core will reject transfers that attempt to use an unsupported bits_per_word value. Also remove the duplicate code to test spi->mode, it is done by spi core. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c index e3d29a56d70a..95bd2ffb0572 100644 --- a/drivers/spi/spi-mpc52xx.c +++ b/drivers/spi/spi-mpc52xx.c @@ -357,17 +357,6 @@ static void mpc52xx_spi_wq(struct work_struct *work) * spi_master ops */ -static int mpc52xx_spi_setup(struct spi_device *spi) -{ - if (spi->bits_per_word % 8) - return -EINVAL; - - if (spi->mode & ~(SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST)) - return -EINVAL; - - return 0; -} - static int mpc52xx_spi_transfer(struct spi_device *spi, struct spi_message *m) { struct mpc52xx_spi *ms = spi_master_get_devdata(spi->master); @@ -430,9 +419,9 @@ static int mpc52xx_spi_probe(struct platform_device *op) goto err_alloc; } - master->setup = mpc52xx_spi_setup; master->transfer = mpc52xx_spi_transfer; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; + master->bits_per_word_mask = SPI_BPW_MASK(8); master->dev.of_node = op->dev.of_node; platform_set_drvdata(op, master);