Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9931a26e authored by Russell King's avatar Russell King
Browse files

DMA-API: net: intel/e1000: replace dma_set_mask()+dma_set_coherent_mask() 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().

Acked-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4c15c243
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -1018,19 +1018,14 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	 */
	 */
	pci_using_dac = 0;
	pci_using_dac = 0;
	if ((hw->bus_type == e1000_bus_type_pcix) &&
	if ((hw->bus_type == e1000_bus_type_pcix) &&
	    !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
	    !dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
		/* according to DMA-API-HOWTO, coherent calls will always
		 * succeed if the set call did
		 */
		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
		pci_using_dac = 1;
		pci_using_dac = 1;
	} else {
	} else {
		err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
		if (err) {
		if (err) {
			pr_err("No usable DMA config, aborting\n");
			pr_err("No usable DMA config, aborting\n");
			goto err_dma;
			goto err_dma;
		}
		}
		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
	}
	}


	netdev->netdev_ops = &e1000_netdev_ops;
	netdev->netdev_ops = &e1000_netdev_ops;