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

Commit 910638ae authored by Matthias Gehre's avatar Matthias Gehre Committed by Linus Torvalds
Browse files

[PATCH] Replace 0xff.. with correct DMA_xBIT_MASK



Replace all occurences of 0xff..  in calls to function pci_set_dma_mask()
and pci_set_consistant_dma_mask() with the corresponding DMA_xBIT_MASK from
linux/dma-mapping.h.

Signed-off-by: default avatarMatthias Gehre <M.Gehre@gmx.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 60c904ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -199,6 +199,8 @@ address during PCI bus mastering you might do something like:
		       "mydev: 24-bit DMA addressing not available.\n");
		goto ignore_this_device;
	}
[Better use DMA_24BIT_MASK instead of 0x00ffffff.
See linux/include/dma-mapping.h for reference.]

When pci_set_dma_mask() is successful, and returns zero, the PCI layer
saves away this mask you have provided.  The PCI layer will use this
+1 −1
Original line number Diff line number Diff line
@@ -1972,7 +1972,7 @@ static int __devinit lanai_pci_start(struct lanai_dev *lanai)
		    "(itf %d): No suitable DMA available.\n", lanai->number);
		return -EBUSY;
	}
	if (pci_set_consistent_dma_mask(pci, 0xFFFFFFFF) != 0) {
	if (pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) != 0) {
		printk(KERN_WARNING DEV_LABEL
		    "(itf %d): No suitable DMA available.\n", lanai->number);
		return -EBUSY;
+3 −2
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include <linux/timer.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>

#include <linux/fcntl.h>        /* O_ACCMODE */
#include <linux/hdreg.h>  /* HDIO_GETGEO */
@@ -881,8 +882,8 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i
	printk(KERN_INFO "Micro Memory(tm) controller #%d found at %02x:%02x (PCI Mem Module (Battery Backup))\n",
	       card->card_number, dev->bus->number, dev->devfn);

	if (pci_set_dma_mask(dev, 0xffffffffffffffffLL) &&
	    pci_set_dma_mask(dev, 0xffffffffLL)) {
	if (pci_set_dma_mask(dev, DMA_64BIT_MASK) &&
	    pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
		printk(KERN_WARNING "MM%d: NO suitable DMA found\n",num_cards);
		return  -ENOMEM;
	}
+2 −1
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@
#include <linux/random.h>
#include <linux/init.h>
#include <linux/if_vlan.h>
#include <linux/dma-mapping.h>

#include <asm/irq.h>
#include <asm/io.h>
@@ -2932,7 +2933,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
	if (id->driver_data & DEV_HAS_HIGH_DMA) {
		/* packet format 3: supports 40-bit addressing */
		np->desc_ver = DESC_VER_3;
		if (pci_set_dma_mask(pci_dev, 0x0000007fffffffffULL)) {
		if (pci_set_dma_mask(pci_dev, DMA_39BIT_MASK)) {
			printk(KERN_INFO "forcedeth: 64-bit DMA failed, using 32-bit addressing for device %s.\n",
					pci_name(pci_dev));
		} else {
+4 −3
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/dma-mapping.h>

#ifdef CONFIG_SERIAL_8250
#include <linux/serial_core.h>
@@ -1195,17 +1196,17 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	int err, pci_using_dac;

	/* Configure DMA attributes. */
	err = pci_set_dma_mask(pdev, 0xffffffffffffffffULL);
	err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
	if (!err) {
		pci_using_dac = 1;
		err = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL);
		err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
		if (err < 0) {
			printk(KERN_ERR "%s: Unable to obtain 64 bit DMA "
			       "for consistent allocations\n", pci_name(pdev));
			goto out;
		}
	} else {
		err = pci_set_dma_mask(pdev, 0xffffffffULL);
		err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
		if (err) {
			printk(KERN_ERR "%s: No usable DMA configuration, "
			       "aborting.\n", pci_name(pdev));
Loading