diff options
author | Stephen Warren <swarren@wwwdotorg.org> | 2013-05-21 22:36:35 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-29 15:48:17 -0400 |
commit | 24778be20f87d5aadb19624fc768b3159fa43efc (patch) | |
tree | 05124574b6d331f34938bbae09d4014fde7dca76 /drivers/spi/spi-bfin-sport.c | |
parent | 2922a8de996956893bb98e4aa91be9774c958336 (diff) |
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>
Diffstat (limited to 'drivers/spi/spi-bfin-sport.c')
-rw-r--r-- | drivers/spi/spi-bfin-sport.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/spi/spi-bfin-sport.c b/drivers/spi/spi-bfin-sport.c index 39b0d1711b4e..e4a858ad6ef6 100644 --- a/drivers/spi/spi-bfin-sport.c +++ b/drivers/spi/spi-bfin-sport.c | |||
@@ -417,7 +417,7 @@ bfin_sport_spi_pump_transfers(unsigned long data) | |||
417 | 417 | ||
418 | /* Bits per word setup */ | 418 | /* Bits per word setup */ |
419 | bits_per_word = transfer->bits_per_word; | 419 | bits_per_word = transfer->bits_per_word; |
420 | if (bits_per_word % 16 == 0) | 420 | if (bits_per_word == 16) |
421 | drv_data->ops = &bfin_sport_transfer_ops_u16; | 421 | drv_data->ops = &bfin_sport_transfer_ops_u16; |
422 | else | 422 | else |
423 | drv_data->ops = &bfin_sport_transfer_ops_u8; | 423 | drv_data->ops = &bfin_sport_transfer_ops_u8; |
@@ -600,13 +600,6 @@ bfin_sport_spi_setup(struct spi_device *spi) | |||
600 | } | 600 | } |
601 | } | 601 | } |
602 | 602 | ||
603 | if (spi->bits_per_word % 8) { | ||
604 | dev_err(&spi->dev, "%d bits_per_word is not supported\n", | ||
605 | spi->bits_per_word); | ||
606 | ret = -EINVAL; | ||
607 | goto error; | ||
608 | } | ||
609 | |||
610 | /* translate common spi framework into our register | 603 | /* translate common spi framework into our register |
611 | * following configure contents are same for tx and rx. | 604 | * following configure contents are same for tx and rx. |
612 | */ | 605 | */ |
@@ -778,6 +771,7 @@ static int bfin_sport_spi_probe(struct platform_device *pdev) | |||
778 | drv_data->pin_req = platform_info->pin_req; | 771 | drv_data->pin_req = platform_info->pin_req; |
779 | 772 | ||
780 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; | 773 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; |
774 | master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16); | ||
781 | master->bus_num = pdev->id; | 775 | master->bus_num = pdev->id; |
782 | master->num_chipselect = platform_info->num_chipselect; | 776 | master->num_chipselect = platform_info->num_chipselect; |
783 | master->cleanup = bfin_sport_spi_cleanup; | 777 | master->cleanup = bfin_sport_spi_cleanup; |