]> err.no Git - linux-2.6/commitdiff
x86: use dev_to_node() to get node for device in dma_alloc_pages()
authorYinghai Lu <Yinghai.Lu@Sun.COM>
Wed, 17 Oct 2007 16:04:35 +0000 (18:04 +0200)
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>
Wed, 17 Oct 2007 18:15:47 +0000 (20:15 +0200)
use dev_to_node() to get node for device in dma_alloc_pages().

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/pci-dma_64.c

index 9576a2eb375ed81f5aee52e657676cd74dbad4f9..b2b42bdb0a150c8f1d74f6630d1f9dc0be3569a2 100644 (file)
@@ -51,11 +51,9 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
 {
        struct page *page;
        int node;
-#ifdef CONFIG_PCI
-       if (dev->bus == &pci_bus_type)
-               node = pcibus_to_node(to_pci_dev(dev)->bus);
-       else
-#endif
+
+       node = dev_to_node(dev);
+       if (node == -1)
                node = numa_node_id();
 
        if (node < first_node(node_online_map))