diff options
| -rw-r--r-- | drivers/spi/spi-rockchip.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index daabbabd26b0..1a777dc261d6 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c | |||
| @@ -437,6 +437,7 @@ static void rockchip_spi_prepare_dma(struct rockchip_spi *rs) | |||
| 437 | rs->state &= ~TXBUSY; | 437 | rs->state &= ~TXBUSY; |
| 438 | spin_unlock_irqrestore(&rs->lock, flags); | 438 | spin_unlock_irqrestore(&rs->lock, flags); |
| 439 | 439 | ||
| 440 | rxdesc = NULL; | ||
| 440 | if (rs->rx) { | 441 | if (rs->rx) { |
| 441 | rxconf.direction = rs->dma_rx.direction; | 442 | rxconf.direction = rs->dma_rx.direction; |
| 442 | rxconf.src_addr = rs->dma_rx.addr; | 443 | rxconf.src_addr = rs->dma_rx.addr; |
| @@ -453,6 +454,7 @@ static void rockchip_spi_prepare_dma(struct rockchip_spi *rs) | |||
| 453 | rxdesc->callback_param = rs; | 454 | rxdesc->callback_param = rs; |
| 454 | } | 455 | } |
| 455 | 456 | ||
| 457 | txdesc = NULL; | ||
| 456 | if (rs->tx) { | 458 | if (rs->tx) { |
| 457 | txconf.direction = rs->dma_tx.direction; | 459 | txconf.direction = rs->dma_tx.direction; |
| 458 | txconf.dst_addr = rs->dma_tx.addr; | 460 | txconf.dst_addr = rs->dma_tx.addr; |
| @@ -470,7 +472,7 @@ static void rockchip_spi_prepare_dma(struct rockchip_spi *rs) | |||
| 470 | } | 472 | } |
| 471 | 473 | ||
| 472 | /* rx must be started before tx due to spi instinct */ | 474 | /* rx must be started before tx due to spi instinct */ |
| 473 | if (rs->rx) { | 475 | if (rxdesc) { |
| 474 | spin_lock_irqsave(&rs->lock, flags); | 476 | spin_lock_irqsave(&rs->lock, flags); |
| 475 | rs->state |= RXBUSY; | 477 | rs->state |= RXBUSY; |
| 476 | spin_unlock_irqrestore(&rs->lock, flags); | 478 | spin_unlock_irqrestore(&rs->lock, flags); |
| @@ -478,7 +480,7 @@ static void rockchip_spi_prepare_dma(struct rockchip_spi *rs) | |||
| 478 | dma_async_issue_pending(rs->dma_rx.ch); | 480 | dma_async_issue_pending(rs->dma_rx.ch); |
| 479 | } | 481 | } |
| 480 | 482 | ||
| 481 | if (rs->tx) { | 483 | if (txdesc) { |
| 482 | spin_lock_irqsave(&rs->lock, flags); | 484 | spin_lock_irqsave(&rs->lock, flags); |
| 483 | rs->state |= TXBUSY; | 485 | rs->state |= TXBUSY; |
| 484 | spin_unlock_irqrestore(&rs->lock, flags); | 486 | spin_unlock_irqrestore(&rs->lock, flags); |
