diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 16:40:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 16:40:47 -0400 |
commit | a0bfb673dca8a2b4324fe11e678ec6d6a9ad67e0 (patch) | |
tree | b5a473c95d671e6a62fc4520d01a7a4721820794 /drivers/pci/slot.c | |
parent | 92b29b86fe2e183d44eb467e5e74a5f718ef2e43 (diff) | |
parent | 96499871f45b9126157b1a5c512d6e30f1635225 (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (41 commits)
PCI: fix pci_ioremap_bar() on s390
PCI: fix AER capability check
PCI: use pci_find_ext_capability everywhere
PCI: remove #ifdef DEBUG around dev_dbg call
PCI hotplug: fix get_##name return value problem
PCI: document the pcie_aspm kernel parameter
PCI: introduce an pci_ioremap(pdev, barnr) function
powerpc/PCI: Add legacy PCI access via sysfs
PCI: Add ability to mmap legacy_io on some platforms
PCI: probing debug message uniformization
PCI: support PCIe ARI capability
PCI: centralize the capabilities code in probe.c
PCI: centralize the capabilities code in pci-sysfs.c
PCI: fix 64-vbit prefetchable memory resource BARs
PCI: replace cfg space size (256/4096) by macros.
PCI: use resource_size() everywhere.
PCI: use same arg names in PCI_VDEVICE comment
PCI hotplug: rpaphp: make debug var unique
PCI: use %pF instead of print_fn_descriptor_symbol() in quirks.c
PCI: fix hotplug get_##name return value problem
...
Diffstat (limited to 'drivers/pci/slot.c')
-rw-r--r-- | drivers/pci/slot.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 7e5b85cbd948..0c6db03698ea 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c | |||
@@ -49,11 +49,16 @@ static ssize_t address_read_file(struct pci_slot *slot, char *buf) | |||
49 | 49 | ||
50 | static void pci_slot_release(struct kobject *kobj) | 50 | static void pci_slot_release(struct kobject *kobj) |
51 | { | 51 | { |
52 | struct pci_dev *dev; | ||
52 | struct pci_slot *slot = to_pci_slot(kobj); | 53 | struct pci_slot *slot = to_pci_slot(kobj); |
53 | 54 | ||
54 | pr_debug("%s: releasing pci_slot on %x:%d\n", __func__, | 55 | pr_debug("%s: releasing pci_slot on %x:%d\n", __func__, |
55 | slot->bus->number, slot->number); | 56 | slot->bus->number, slot->number); |
56 | 57 | ||
58 | list_for_each_entry(dev, &slot->bus->devices, bus_list) | ||
59 | if (PCI_SLOT(dev->devfn) == slot->number) | ||
60 | dev->slot = NULL; | ||
61 | |||
57 | list_del(&slot->list); | 62 | list_del(&slot->list); |
58 | 63 | ||
59 | kfree(slot); | 64 | kfree(slot); |
@@ -108,6 +113,7 @@ static struct kobj_type pci_slot_ktype = { | |||
108 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | 113 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, |
109 | const char *name) | 114 | const char *name) |
110 | { | 115 | { |
116 | struct pci_dev *dev; | ||
111 | struct pci_slot *slot; | 117 | struct pci_slot *slot; |
112 | int err; | 118 | int err; |
113 | 119 | ||
@@ -150,6 +156,10 @@ placeholder: | |||
150 | INIT_LIST_HEAD(&slot->list); | 156 | INIT_LIST_HEAD(&slot->list); |
151 | list_add(&slot->list, &parent->slots); | 157 | list_add(&slot->list, &parent->slots); |
152 | 158 | ||
159 | list_for_each_entry(dev, &parent->devices, bus_list) | ||
160 | if (PCI_SLOT(dev->devfn) == slot_nr) | ||
161 | dev->slot = slot; | ||
162 | |||
153 | /* Don't care if debug printk has a -1 for slot_nr */ | 163 | /* Don't care if debug printk has a -1 for slot_nr */ |
154 | pr_debug("%s: created pci_slot on %04x:%02x:%02x\n", | 164 | pr_debug("%s: created pci_slot on %04x:%02x:%02x\n", |
155 | __func__, pci_domain_nr(parent), parent->number, slot_nr); | 165 | __func__, pci_domain_nr(parent), parent->number, slot_nr); |