Skip to content

Commit 04e8c7b

Browse files
metaliveblogRussell King
authored andcommitted
ARM: 7464/1: mmc: omap_hsmmc: ensure probe returns error if DMA channel 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>
1 parent 4e1755b commit 04e8c7b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/mmc/host/omap_hsmmc.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,12 +1924,14 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
19241924
host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req);
19251925
if (!host->rx_chan) {
19261926
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
1927+
ret = -ENXIO;
19271928
goto err_irq;
19281929
}
19291930

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

0 commit comments

Comments
 (0)