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>
This commit is contained in:
Scott Jiang 2012-04-23 18:18:12 -04:00 committed by Grant Likely
parent 8d9d2a4b6c
commit 128465ca7c

View File

@ -396,7 +396,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id)
/* last read */ /* last read */
if (drv_data->rx) { if (drv_data->rx) {
dev_dbg(&drv_data->pdev->dev, "last read\n"); dev_dbg(&drv_data->pdev->dev, "last read\n");
if (n_bytes % 2) { if (!(n_bytes % 2)) {
u16 *buf = (u16 *)drv_data->rx; u16 *buf = (u16 *)drv_data->rx;
for (loop = 0; loop < n_bytes / 2; loop++) for (loop = 0; loop < n_bytes / 2; loop++)
*buf++ = bfin_read(&drv_data->regs->rdbr); *buf++ = bfin_read(&drv_data->regs->rdbr);
@ -424,7 +424,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id)
if (drv_data->rx && drv_data->tx) { if (drv_data->rx && drv_data->tx) {
/* duplex */ /* duplex */
dev_dbg(&drv_data->pdev->dev, "duplex: write_TDBR\n"); dev_dbg(&drv_data->pdev->dev, "duplex: write_TDBR\n");
if (n_bytes % 2) { if (!(n_bytes % 2)) {
u16 *buf = (u16 *)drv_data->rx; u16 *buf = (u16 *)drv_data->rx;
u16 *buf2 = (u16 *)drv_data->tx; u16 *buf2 = (u16 *)drv_data->tx;
for (loop = 0; loop < n_bytes / 2; loop++) { 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)
} else if (drv_data->rx) { } else if (drv_data->rx) {
/* read */ /* read */
dev_dbg(&drv_data->pdev->dev, "read: write_TDBR\n"); dev_dbg(&drv_data->pdev->dev, "read: write_TDBR\n");
if (n_bytes % 2) { if (!(n_bytes % 2)) {
u16 *buf = (u16 *)drv_data->rx; u16 *buf = (u16 *)drv_data->rx;
for (loop = 0; loop < n_bytes / 2; loop++) { for (loop = 0; loop < n_bytes / 2; loop++) {
*buf++ = bfin_read(&drv_data->regs->rdbr); *buf++ = bfin_read(&drv_data->regs->rdbr);
@ -458,7 +458,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id)
} else if (drv_data->tx) { } else if (drv_data->tx) {
/* write */ /* write */
dev_dbg(&drv_data->pdev->dev, "write: write_TDBR\n"); dev_dbg(&drv_data->pdev->dev, "write: write_TDBR\n");
if (n_bytes % 2) { if (!(n_bytes % 2)) {
u16 *buf = (u16 *)drv_data->tx; u16 *buf = (u16 *)drv_data->tx;
for (loop = 0; loop < n_bytes / 2; loop++) { for (loop = 0; loop < n_bytes / 2; loop++) {
bfin_read(&drv_data->regs->rdbr); bfin_read(&drv_data->regs->rdbr);