Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94814
b: refs/heads/master
c: 0d358f2
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Apr 26, 2008
1 parent ad89279 commit 9950390
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d39398a333ddc490f842ccdd4b76c9674682aa5d
refs/heads/master: 0d358f22f6c8f03ab215eee8d52b74f78cc3c7db
14 changes: 12 additions & 2 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ int device_add(struct device *dev)
parent = get_device(dev->parent);
setup_parent(dev, parent);

/* use parent numa_node */
if (parent)
set_dev_node(dev, dev_to_node(parent));

/* first, register with generic layer. */
error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id);
if (error)
Expand Down Expand Up @@ -1306,8 +1310,11 @@ int device_move(struct device *dev, struct device *new_parent)
dev->parent = new_parent;
if (old_parent)
klist_remove(&dev->knode_parent);
if (new_parent)
if (new_parent) {
klist_add_tail(&dev->knode_parent, &new_parent->klist_children);
set_dev_node(dev, dev_to_node(new_parent));
}

if (!dev->class)
goto out_put;
error = device_move_class_links(dev, old_parent, new_parent);
Expand All @@ -1317,9 +1324,12 @@ int device_move(struct device *dev, struct device *new_parent)
if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
if (new_parent)
klist_remove(&dev->knode_parent);
if (old_parent)
dev->parent = old_parent;
if (old_parent) {
klist_add_tail(&dev->knode_parent,
&old_parent->klist_children);
set_dev_node(dev, dev_to_node(old_parent));
}
}
cleanup_glue_dir(dev, new_parent_kobj);
put_device(new_parent);
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
dev->dev.release = pci_release_dev;
pci_dev_get(dev);

set_dev_node(&dev->dev, pcibus_to_node(bus));
dev->dev.dma_mask = &dev->dma_mask;
dev->dev.dma_parms = &dev->dma_parms;
dev->dev.coherent_dma_mask = 0xffffffffull;
Expand Down Expand Up @@ -1128,6 +1127,9 @@ struct pci_bus * pci_create_bus(struct device *parent,
goto dev_reg_err;
b->bridge = get_device(dev);

if (!parent)
set_dev_node(b->bridge, pcibus_to_node(b));

b->dev.class = &pcibus_class;
b->dev.parent = b->bridge;
sprintf(b->dev.bus_id, "%04x:%02x", pci_domain_nr(b), bus);
Expand Down

0 comments on commit 9950390

Please sign in to comment.