Skip to content

Commit

Permalink
DMA-API: net: emulex/benet: replace dma_set_mask()+dma_set_coherent_m…
Browse files Browse the repository at this point in the history
…ask() with new helper

Replace the following sequence:

	dma_set_mask(dev, mask);
	dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Sep 21, 2013
1 parent 1bfa2c4 commit 4c15c24
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4335,19 +4335,11 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
adapter->netdev = netdev;
SET_NETDEV_DEV(netdev, &pdev->dev);

status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
status = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (!status) {
status = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
if (status < 0) {
dev_err(&pdev->dev, "dma_set_coherent_mask failed\n");
goto free_netdev;
}
netdev->features |= NETIF_F_HIGHDMA;
} else {
status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (!status)
status = dma_set_coherent_mask(&pdev->dev,
DMA_BIT_MASK(32));
status = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (status) {
dev_err(&pdev->dev, "Could not set PCI DMA Mask\n");
goto free_netdev;
Expand Down

0 comments on commit 4c15c24

Please sign in to comment.