]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pnp/core.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / pnp / core.c
index aec83ec5ea23f2471c55fbbe3dafd073b296c42e..8e7b2dd3881086de3d95a8c6d9f34357827306a1 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/dma-mapping.h>
 
 #include "base.h"
 
@@ -22,16 +23,23 @@ static LIST_HEAD(pnp_protocols);
 LIST_HEAD(pnp_global);
 DEFINE_SPINLOCK(pnp_lock);
 
+/*
+ * ACPI or PNPBIOS should tell us about all platform devices, so we can
+ * skip some blind probes.  ISAPNP typically enumerates only plug-in ISA
+ * devices, not built-in things like COM ports.
+ */
+int pnp_platform_devices;
+EXPORT_SYMBOL(pnp_platform_devices);
+
 void *pnp_alloc(long size)
 {
        void *result;
 
-       result = kmalloc(size, GFP_KERNEL);
+       result = kzalloc(size, GFP_KERNEL);
        if (!result){
                printk(KERN_ERR "pnp: Out of Memory\n");
                return NULL;
        }
-       memset(result, 0, size);
        return result;
 }
 
@@ -114,6 +122,8 @@ int __pnp_add_device(struct pnp_dev *dev)
        int ret;
        pnp_fixup_device(dev);
        dev->dev.bus = &pnp_bus_type;
+       dev->dev.dma_mask = &dev->dma_mask;
+       dev->dma_mask = dev->dev.coherent_dma_mask = DMA_24BIT_MASK;
        dev->dev.release = &pnp_release_device;
        dev->status = PNP_READY;
        spin_lock(&pnp_lock);