diff options
author | Scott Jiang <scott.jiang.linux@gmail.com> | 2012-04-23 18:18:12 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-04-27 14:19:01 -0400 |
commit | 128465ca7c0775609b1c24f66cd6bddac5f59c9b (patch) | |
tree | c3d4b1c135e36bbd0f99b56c8f50ec1c7fe71cf1 /drivers/spi/spi-bfin5xx.c | |
parent | 8d9d2a4b6ca0013b62a438808d22bdd615abcd00 (diff) |
spi/spi-bfin5xx: fix reversed if condition in interrupt mode
This condition is used to determine 8 bits or 16 and 32 bits transfer.
Obviously it is reversed.
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-bfin5xx.c')
-rw-r--r-- | drivers/spi/spi-bfin5xx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index c0cdcb7c8135..432d0190e6ba 100644 --- a/drivers/spi/spi-bfin5xx.c +++ b/drivers/spi/spi-bfin5xx.c | |||
@@ -396,7 +396,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) | |||
396 | /* last read */ | 396 | /* last read */ |
397 | if (drv_data->rx) { | 397 | if (drv_data->rx) { |
398 | dev_dbg(&drv_data->pdev->dev, "last read\n"); | 398 | dev_dbg(&drv_data->pdev->dev, "last read\n"); |
399 | if (n_bytes % 2) { | 399 | if (!(n_bytes % 2)) { |
400 | u16 *buf = (u16 *)drv_data->rx; | 400 | u16 *buf = (u16 *)drv_data->rx; |
401 | for (loop = 0; loop < n_bytes / 2; loop++) | 401 | for (loop = 0; loop < n_bytes / 2; loop++) |
402 | *buf++ = bfin_read(&drv_data->regs->rdbr); | 402 | *buf++ = bfin_read(&drv_data->regs->rdbr); |
@@ -424,7 +424,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) | |||
424 | if (drv_data->rx && drv_data->tx) { | 424 | if (drv_data->rx && drv_data->tx) { |
425 | /* duplex */ | 425 | /* duplex */ |
426 | dev_dbg(&drv_data->pdev->dev, "duplex: write_TDBR\n"); | 426 | dev_dbg(&drv_data->pdev->dev, "duplex: write_TDBR\n"); |
427 | if (n_bytes % 2) { | 427 | if (!(n_bytes % 2)) { |
428 | u16 *buf = (u16 *)drv_data->rx; | 428 | u16 *buf = (u16 *)drv_data->rx; |
429 | u16 *buf2 = (u16 *)drv_data->tx; | 429 | u16 *buf2 = (u16 *)drv_data->tx; |
430 | for (loop = 0; loop < n_bytes / 2; loop++) { | 430 | for (loop = 0; loop < n_bytes / 2; loop++) { |
@@ -442,7 +442,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) | |||
442 | } else if (drv_data->rx) { | 442 | } else if (drv_data->rx) { |
443 | /* read */ | 443 | /* read */ |
444 | dev_dbg(&drv_data->pdev->dev, "read: write_TDBR\n"); | 444 | dev_dbg(&drv_data->pdev->dev, "read: write_TDBR\n"); |
445 | if (n_bytes % 2) { | 445 | if (!(n_bytes % 2)) { |
446 | u16 *buf = (u16 *)drv_data->rx; | 446 | u16 *buf = (u16 *)drv_data->rx; |
447 | for (loop = 0; loop < n_bytes / 2; loop++) { | 447 | for (loop = 0; loop < n_bytes / 2; loop++) { |
448 | *buf++ = bfin_read(&drv_data->regs->rdbr); | 448 | *buf++ = bfin_read(&drv_data->regs->rdbr); |
@@ -458,7 +458,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) | |||
458 | } else if (drv_data->tx) { | 458 | } else if (drv_data->tx) { |
459 | /* write */ | 459 | /* write */ |
460 | dev_dbg(&drv_data->pdev->dev, "write: write_TDBR\n"); | 460 | dev_dbg(&drv_data->pdev->dev, "write: write_TDBR\n"); |
461 | if (n_bytes % 2) { | 461 | if (!(n_bytes % 2)) { |
462 | u16 *buf = (u16 *)drv_data->tx; | 462 | u16 *buf = (u16 *)drv_data->tx; |
463 | for (loop = 0; loop < n_bytes / 2; loop++) { | 463 | for (loop = 0; loop < n_bytes / 2; loop++) { |
464 | bfin_read(&drv_data->regs->rdbr); | 464 | bfin_read(&drv_data->regs->rdbr); |