pcmcia: use DMA_MASK_NONE for the default for all pcmcia devices
authorJames Bottomley <James.Bottomley@SteelEye.com>
Tue, 16 Oct 2007 08:23:58 +0000 (01:23 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:42:50 +0000 (09:42 -0700)
Most non cardbus devices can't do dma, so flag them as such in the device
creation routine.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Natalie Protasevich <protasnb@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/pcmcia/ds.c
include/pcmcia/ds.h

index 55baa1f0fcbb5f8893456d117a5439bf7f1a950c..7bf78c127898d7e951c925c526d1c1d2b5d4621d 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/crc32.h>
 #include <linux/firmware.h>
 #include <linux/kref.h>
+#include <linux/dma-mapping.h>
 
 #define IN_CARD_SERVICES
 #include <pcmcia/cs_types.h>
@@ -670,6 +671,9 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
        p_dev->dev.bus = &pcmcia_bus_type;
        p_dev->dev.parent = s->dev.parent;
        p_dev->dev.release = pcmcia_release_dev;
+       /* by default don't allow DMA */
+       p_dev->dma_mask = DMA_MASK_NONE;
+       p_dev->dev.dma_mask = &p_dev->dma_mask;
        bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
 
        p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL);
index 90ef552c42dd638f8557d6af3f0abc1963db7d8b..f047a1fd64f803a887ce40430a7e14a86d0e4627 100644 (file)
@@ -184,6 +184,7 @@ struct pcmcia_device {
 
        char *                  prod_id[4];
 
+       u64                     dma_mask;
        struct device           dev;
 
 #ifdef CONFIG_PCMCIA_IOCTL