spi-gpio: init CS before spi_bitbang_setup()
PATCH 1/1 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().
--- drivers/spi/spi-gpio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/spi/spi-gpio.c +1 -1
@@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi) } }if (!status) { - status =spi_bitbang_setup (spi);/* in case it was initialized from static board data */ spi_gpio->cs_gpios[spi->chip_select] = cs; + status =spi_bitbang_setup (spi); }if (status) {
Signature · 9 lines
1.7.0.7 ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter
Quoted 32 lines · Josef Ahmad
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 intospi_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 <[email protected]>Signed-off-by Josef Ahmad <[email protected]>--- drivers/spi/spi-gpio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/spi/spi-gpio.c +1
-1@@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi) } }if (!status) { - status =spi_bitbang_setup (spi);/* in case it was initialized from static board data */ spi_gpio->cs_gpios[spi->chip_select] = cs; + status =spi_bitbang_setup (spi); }if (status) {
Quoted 5 lines · Daniel Mack
Cc MarkQuoted 2 lines · Josef Ahmad
spi_bitbang_setup()deasserts the chip select line to initialise the device. The chip select GPIO line is obtained from
Please resend the patch - git am doesn't know how to strip off quotation stuff!
Quoted 10 lines · Mark Brown
Quoted 5 lines · Daniel Mack
Cc MarkQuoted 2 lines · Josef Ahmad
spi_bitbang_setup()deasserts the chip select line to initialise the device. The chip select GPIO line is obtained fromPlease resend the patch - git am doesn't know how to strip off quotation stuff!
The reply was fyi only, as the patch also went to spi-devel-general. Can you pick it from there or should Josef send it again with your address in Cc:?
Quoted 3 lines · Daniel Mack
The reply was fyi only, as the patch also went to spi-devel-general. Can you pick it from there or should Josef send it again with your address in Cc:?
Please make sure stuff goes to my inbox, I *can* pick up from -devel-general but it's generally painful as my list traffic is going to a different e-mail account and so on (plus I'm heavily backlogged on list traffic in general at the minute, and sourceforge is full of spam).