Skip to content

Commit

Permalink
x86: use dev_to_node() to get node for device in dma_alloc_pages()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yinghai Lu authored and Thomas Gleixner committed Oct 17, 2007
1 parent 8f8ae1a commit f6855f7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/x86/kernel/pci-dma_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit f6855f7

Please sign in to comment.