bcm63xx: add 3.9 support
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.9 / 012-spi-bcm63xx-inline-bcm63xx_spi_check_transfer.patch
1 From 3fffc5f76c830c375692a67948734168ee4c516a Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Mon, 11 Mar 2013 13:59:30 +0100
4 Subject: [PATCH 10/12] spi/bcm63xx: inline bcm63xx_spi_check_transfer
5
6 It only does one check, so just do the check directly in the caller.
7
8 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
9 ---
10 drivers/spi/spi-bcm63xx.c | 19 +++++--------------
11 1 file changed, 5 insertions(+), 14 deletions(-)
12
13 --- a/drivers/spi/spi-bcm63xx.c
14 +++ b/drivers/spi/spi-bcm63xx.c
15 @@ -93,18 +93,6 @@ static const unsigned bcm63xx_spi_freq_t
16 { 391000, SPI_CLK_0_391MHZ }
17 };
18
19 -static int bcm63xx_spi_check_transfer(struct spi_device *spi,
20 - struct spi_transfer *t)
21 -{
22 - if (t->bits_per_word != 8) {
23 - dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
24 - __func__, t->bits_per_word);
25 - return -EINVAL;
26 - }
27 -
28 - return 0;
29 -}
30 -
31 static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
32 struct spi_transfer *t)
33 {
34 @@ -293,9 +281,12 @@ static int bcm63xx_spi_transfer_one(stru
35 * full-duplex transfers.
36 */
37 list_for_each_entry(t, &m->transfers, transfer_list) {
38 - status = bcm63xx_spi_check_transfer(spi, t);
39 - if (status < 0)
40 + if (t->bits_per_word != 8) {
41 + dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
42 + __func__, t->bits_per_word);
43 + status = -EINVAL;
44 goto exit;
45 + }
46
47 if (!first)
48 first = t;