]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
DMA-API: net: brocade/bna/bnad.c: fix 32-bit DMA mask handling
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 10 Jun 2013 11:16:54 +0000 (12:16 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 17 Sep 2013 14:32:38 +0000 (15:32 +0100)
commit3e5480791e3b0e239d2cd4e5ecd43a7d2585484b
treeb7357da0c59892bba369ad27fb46716b8a9f5671
parent4aa806b771d16b810771d86ce23c4c3160888db3
DMA-API: net: brocade/bna/bnad.c: fix 32-bit DMA mask handling

The fallback to 32-bit DMA mask is rather odd:
if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
    !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
*using_dac = true;
} else {
err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
err = dma_set_coherent_mask(&pdev->dev,
    DMA_BIT_MASK(32));
if (err)
goto release_regions;
}

This means we only try and set the coherent DMA mask if we failed to
set a 32-bit DMA mask, and only if both fail do we fail the driver.
Adjust this so that if either setting fails, we fail the driver - and
thereby end up properly setting both the DMA mask and the coherent
DMA mask in the fallback case.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/net/ethernet/brocade/bna/bnad.c