[PATCH 4/4] driver: use dev_to_node in pci_call_probe

From: Yinghai Lu
Date: Wed Feb 20 2008 - 03:41:10 EST


to make sure get one online node.

Signed-off-by: Yinghai Lu <yinghai.lu@xxxxxxx>

Index: linux-2.6/drivers/pci/pci-driver.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-driver.c
+++ linux-2.6/drivers/pci/pci-driver.c
@@ -181,8 +181,8 @@ static int pci_call_probe(struct pci_dri
any need to change it. */
struct mempolicy *oldpol;
cpumask_t oldmask = current->cpus_allowed;
- int node = pcibus_to_node(dev->bus);
- if (node >= 0 && node_online(node))
+ int node = dev_to_node(&dev->dev);
+ if (node >= 0)
set_cpus_allowed(current, node_to_cpumask(node));
/* And set default memory allocation policy */
oldpol = current->mempolicy;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/