4e1ba944eb74bc9ef192c4f9b4aa6e2a750a10d7
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.1 / 0095-bcm2708-spi-Don-t-use-static-pin-configuration-with-.patch
1 From 83a08affef9c792cbb0e986909e734ef9932a12e Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 15 Jun 2015 09:59:38 +0100
4 Subject: [PATCH 095/148] bcm2708-spi: Don't use static pin configuration with
5 DT
6
7 Also remove superfluous error checking - the SPI framework ensures the
8 validity of the chip_select value.
9 ---
10 drivers/spi/spi-bcm2708.c | 11 ++---------
11 1 file changed, 2 insertions(+), 9 deletions(-)
12
13 --- a/drivers/spi/spi-bcm2708.c
14 +++ b/drivers/spi/spi-bcm2708.c
15 @@ -386,14 +386,6 @@ static int bcm2708_spi_setup(struct spi_
16 if (bs->stopping)
17 return -ESHUTDOWN;
18
19 - if (!(spi->mode & SPI_NO_CS) &&
20 - (spi->chip_select > spi->master->num_chipselect)) {
21 - dev_dbg(&spi->dev,
22 - "setup: invalid chipselect %u (%u defined)\n",
23 - spi->chip_select, spi->master->num_chipselect);
24 - return -EINVAL;
25 - }
26 -
27 state = spi->controller_state;
28 if (!state) {
29 state = kzalloc(sizeof(*state), GFP_KERNEL);
30 @@ -496,7 +488,8 @@ static int bcm2708_spi_probe(struct plat
31 return PTR_ERR(clk);
32 }
33
34 - bcm2708_init_pinmode();
35 + if (!pdev->dev.of_node)
36 + bcm2708_init_pinmode();
37
38 master = spi_alloc_master(&pdev->dev, sizeof(*bs));
39 if (!master) {