From: Yinghai Lu Date: Wed, 17 Oct 2007 16:04:35 +0000 (+0200) Subject: x86: use dev_to_node() to get node for device in dma_alloc_pages() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f6855f7fb2e22c5675d292dd445ee3c1fc09ac18;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 --- 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))