Skip to content

Commit

Permalink
ARM: 7464/1: mmc: omap_hsmmc: ensure probe returns error if DMA chann…
Browse files Browse the repository at this point in the history
…el request fails

If dma_request_channel() fails (e.g. because DMA enine is not built
into the kernel), the return value from probe is zero causing the
driver to be bound to the device even though probe failed.

To fix, ensure that probe returns an error value when a DMA channel
request fail.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Kevin Hilman authored and Russell King committed Jul 31, 2012
1 parent 4e1755b commit 04e8c7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1924,12 +1924,14 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req);
if (!host->rx_chan) {
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
ret = -ENXIO;
goto err_irq;
}

host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req);
if (!host->tx_chan) {
dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req);
ret = -ENXIO;
goto err_irq;
}

Expand Down

0 comments on commit 04e8c7b

Please sign in to comment.