spi: convert drivers to use bits_per_word_mask
Fill in the recently added spi_master.bits_per_word_mask field in as many drivers as possible. Make related cleanups, such as removing any redundant error-checking, or empty setup callbacks. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
committed by
Mark Brown
parent
2922a8de99
commit
24778be20f
@@ -237,14 +237,6 @@ static void ti_ssp_spi_work(struct work_struct *work)
|
||||
spin_unlock(&hw->lock);
|
||||
}
|
||||
|
||||
static int ti_ssp_spi_setup(struct spi_device *spi)
|
||||
{
|
||||
if (spi->bits_per_word > 32)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ti_ssp_spi_transfer(struct spi_device *spi, struct spi_message *m)
|
||||
{
|
||||
struct ti_ssp_spi *hw;
|
||||
@@ -269,12 +261,6 @@ static int ti_ssp_spi_transfer(struct spi_device *spi, struct spi_message *m)
|
||||
dev_err(&spi->dev, "invalid xfer, full duplex\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (t->bits_per_word > 32) {
|
||||
dev_err(&spi->dev, "invalid xfer width %d\n",
|
||||
t->bits_per_word);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
spin_lock(&hw->lock);
|
||||
@@ -337,8 +323,8 @@ static int ti_ssp_spi_probe(struct platform_device *pdev)
|
||||
master->bus_num = pdev->id;
|
||||
master->num_chipselect = pdata->num_cs;
|
||||
master->mode_bits = MODE_BITS;
|
||||
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32);
|
||||
master->flags = SPI_MASTER_HALF_DUPLEX;
|
||||
master->setup = ti_ssp_spi_setup;
|
||||
master->transfer = ti_ssp_spi_transfer;
|
||||
|
||||
error = spi_register_master(master);
|
||||
|
||||
Reference in New Issue
Block a user