aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorJosef Ahmad <josef.ahmad@intel.com>2013-04-09 13:25:34 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-10 09:47:09 -0400
commit6b8cc3306e78490bda26815b04c786d8e1fc1489 (patch)
tree136d5f59d73c5bf51c152fb3aa4af0ee1514e7c7 /drivers/spi
parentc3e2aa861005ec390e8a7556d1a1e980be1a6e1f (diff)
spi-gpio: init CS before spi_bitbang_setup()
spi_bitbang_setup() deasserts the chip select line to initialise the device. The chip select GPIO line is obtained from spi_gpio->cs_gpios[] private data. Currently, devices that are not registered under devicetree environment will call into spi_bitbang_setup() with stale cs_gpios[]. This patch ensures spi_gpio->cs_gpios[] is always initialised prior to calling spi_bitbang_setup(). Reviewed-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Josef Ahmad <josef.ahmad@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 9ddef55a7165..0021fc4c45bc 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi)
265 } 265 }
266 } 266 }
267 if (!status) { 267 if (!status) {
268 status = spi_bitbang_setup(spi);
269 /* in case it was initialized from static board data */ 268 /* in case it was initialized from static board data */
270 spi_gpio->cs_gpios[spi->chip_select] = cs; 269 spi_gpio->cs_gpios[spi->chip_select] = cs;
270 status = spi_bitbang_setup(spi);
271 } 271 }
272 272
273 if (status) { 273 if (status) {