Skip to contentSkip to conversation

spi-gpio: SPI_MASTER_NO_RX bit tested twice, missing SPI_MASTER_NO_TX?

PATCH In review Roel Kluin 2 participants 2 messages Oct 2, 2010 – Oct 3, 2010 SPI

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 spi-gpio: SPI_MASTER_NO_RX bit tested twice, missing SPI_MASTER_NO_TX?

The SPI_MASTER_NO_TX bit (can't do buffer write) wasn't tested.

---
 drivers/spi/spi_gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Is this what was intended?

drivers/spi/spi_gpio.c +1 -1
index e24a634..63e51b0 100644
@@ -350,7 +350,7 @@ static int __init spi_gpio_probe(struct platform_device *pdev)
 	spi_gpio->bitbang.master = spi_master_get(master);
 	spi_gpio->bitbang.chipselect = spi_gpio_chipselect;
 
-	if ((master_flags & (SPI_MASTER_NO_RX | SPI_MASTER_NO_RX)) == 0) {
+	if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) {
 		spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0;
 		spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1;
 		spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2;
#1 lore raw
Quoted 9 lines · Roel Kluin

The SPI_MASTER_NO_TX bit (can't do buffer write) wasn't tested.

---
 drivers/spi/spi_gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Is this what was intended?

Obviously correct. Merged

g.

drivers/spi/spi_gpio.c static int __init spi_gpio_probe(struct platform_device *pdev) · line 356

Quoted 13 lines
drivers/spi/spi_gpio.c +1 -1
index e24a634..63e51b0 100644
@@ -350,7 +350,7 @@ static int __init spi_gpio_probe(struct platform_device *pdev)
 	spi_gpio->bitbang.master = spi_master_get(master);
 	spi_gpio->bitbang.chipselect = spi_gpio_chipselect;
 
-	if ((master_flags & (SPI_MASTER_NO_RX | SPI_MASTER_NO_RX)) == 0) {
+	if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) {
 		spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0;
 		spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1;
 		spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2;

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev