aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2013-03-11 19:13:45 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-12 15:14:47 -0400
commitc94df49542a9cf2c095468e62be6a16ba86dd811 (patch)
tree143e763c38fa1dd74b1f558e02c81eaeb91acaf9 /drivers/spi
parent31e4eaaa54effd8544d1e8679e27d439bb6cb10c (diff)
spi/bcm63xx: inline bcm63xx_spi_check_transfer
It only does one check, so just do the check directly in the caller. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-bcm63xx.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 9574e47e4ff4..d777f6311100 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -93,18 +93,6 @@ static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = {
93 { 391000, SPI_CLK_0_391MHZ } 93 { 391000, SPI_CLK_0_391MHZ }
94}; 94};
95 95
96static int bcm63xx_spi_check_transfer(struct spi_device *spi,
97 struct spi_transfer *t)
98{
99 if (t->bits_per_word != 8) {
100 dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
101 __func__, t->bits_per_word);
102 return -EINVAL;
103 }
104
105 return 0;
106}
107
108static void bcm63xx_spi_setup_transfer(struct spi_device *spi, 96static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
109 struct spi_transfer *t) 97 struct spi_transfer *t)
110{ 98{
@@ -293,9 +281,12 @@ static int bcm63xx_spi_transfer_one(struct spi_master *master,
293 * full-duplex transfers. 281 * full-duplex transfers.
294 */ 282 */
295 list_for_each_entry(t, &m->transfers, transfer_list) { 283 list_for_each_entry(t, &m->transfers, transfer_list) {
296 status = bcm63xx_spi_check_transfer(spi, t); 284 if (t->bits_per_word != 8) {
297 if (status < 0) 285 dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
286 __func__, t->bits_per_word);
287 status = -EINVAL;
298 goto exit; 288 goto exit;
289 }
299 290
300 if (!first) 291 if (!first)
301 first = t; 292 first = t;