aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.1/0095-bcm2708-spi-Don-t-use-static-pin-configuration-with-.patch
blob: 2d24617b9c8f0d09b52e3c0be21928d13b6373d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 37f8282b8ba61d7f79cb5538d6331a04c6bdf883 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 15 Jun 2015 09:59:38 +0100
Subject: [PATCH 095/203] bcm2708-spi: Don't use static pin configuration with
 DT

Also remove superfluous error checking - the SPI framework ensures the
validity of the chip_select value.
---
 drivers/spi/spi-bcm2708.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

--- a/drivers/spi/spi-bcm2708.c
+++ b/drivers/spi/spi-bcm2708.c
@@ -386,14 +386,6 @@ static int bcm2708_spi_setup(struct spi_
 	if (bs->stopping)
 		return -ESHUTDOWN;
 
-	if (!(spi->mode & SPI_NO_CS) &&
-			(spi->chip_select > spi->master->num_chipselect)) {
-		dev_dbg(&spi->dev,
-			"setup: invalid chipselect %u (%u defined)\n",
-			spi->chip_select, spi->master->num_chipselect);
-		return -EINVAL;
-	}
-
 	state = spi->controller_state;
 	if (!state) {
 		state = kzalloc(sizeof(*state), GFP_KERNEL);
@@ -496,7 +488,8 @@ static int bcm2708_spi_probe(struct plat
 		return PTR_ERR(clk);
 	}
 
-	bcm2708_init_pinmode();
+	if (!pdev->dev.of_node)
+		bcm2708_init_pinmode();
 
 	master = spi_alloc_master(&pdev->dev, sizeof(*bs));
 	if (!master) {