Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6855f7f authored by Yinghai Lu's avatar Yinghai Lu Committed by Thomas Gleixner
Browse files

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: default avatarYinghai Lu <yinghai.lu@sun.com>
Acked-by: default avatarChristoph 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 8f8ae1a7
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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))