Skip to content

Commit

Permalink
Merge remote-tracking branches 'spi/fix/dw', 'spi/fix/queue' and 'spi…
Browse files Browse the repository at this point in the history
…/fix/qup' into spi-linus
  • Loading branch information
Mark Brown committed Mar 24, 2015
4 parents bc465aa + 854d2f2 + 391949b + 12cb89e commit 072ac04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions drivers/spi/spi-dw-mid.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ static void dw_spi_dma_tx_done(void *arg)
{
struct dw_spi *dws = arg;

if (test_and_clear_bit(TX_BUSY, &dws->dma_chan_busy) & BIT(RX_BUSY))
clear_bit(TX_BUSY, &dws->dma_chan_busy);
if (test_bit(RX_BUSY, &dws->dma_chan_busy))
return;
dw_spi_xfer_done(dws);
}
Expand Down Expand Up @@ -156,7 +157,8 @@ static void dw_spi_dma_rx_done(void *arg)
{
struct dw_spi *dws = arg;

if (test_and_clear_bit(RX_BUSY, &dws->dma_chan_busy) & BIT(TX_BUSY))
clear_bit(RX_BUSY, &dws->dma_chan_busy);
if (test_bit(TX_BUSY, &dws->dma_chan_busy))
return;
dw_spi_xfer_done(dws);
}
Expand Down
9 changes: 5 additions & 4 deletions drivers/spi/spi-qup.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static int spi_qup_probe(struct platform_device *pdev)
struct resource *res;
struct device *dev;
void __iomem *base;
u32 max_freq, iomode;
u32 max_freq, iomode, num_cs;
int ret, irq, size;

dev = &pdev->dev;
Expand Down Expand Up @@ -550,10 +550,11 @@ static int spi_qup_probe(struct platform_device *pdev)
}

/* use num-cs unless not present or out of range */
if (of_property_read_u16(dev->of_node, "num-cs",
&master->num_chipselect) ||
(master->num_chipselect > SPI_NUM_CHIPSELECTS))
if (of_property_read_u32(dev->of_node, "num-cs", &num_cs) ||
num_cs > SPI_NUM_CHIPSELECTS)
master->num_chipselect = SPI_NUM_CHIPSELECTS;
else
master->num_chipselect = num_cs;

master->bus_num = pdev->id;
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
Expand Down
5 changes: 3 additions & 2 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,13 +1105,14 @@ void spi_finalize_current_message(struct spi_master *master)
"failed to unprepare message: %d\n", ret);
}
}

trace_spi_message_done(mesg);

master->cur_msg_prepared = false;

mesg->state = NULL;
if (mesg->complete)
mesg->complete(mesg->context);

trace_spi_message_done(mesg);
}
EXPORT_SYMBOL_GPL(spi_finalize_current_message);

Expand Down

0 comments on commit 072ac04

Please sign in to comment.