From f6855f7fb2e22c5675d292dd445ee3c1fc09ac18 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Wed, 17 Oct 2007 18:04:35 +0200 Subject: [PATCH] x86: use dev_to_node() to get node for device in dma_alloc_pages() use dev_to_node() to get node for device in dma_alloc_pages(). Signed-off-by: Yinghai Lu Acked-by: Christoph Lameter Cc: Christoph Lameter Cc: Andy Whitcroft Cc: Jeff Garzik Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/pci-dma_64.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 9576a2eb375e..b2b42bdb0a15 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c @@ -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)) -- 2.30.2