diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/slot.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 0c6db03698ea..b9b90ab6b861 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c | |||
@@ -175,7 +175,7 @@ placeholder: | |||
175 | EXPORT_SYMBOL_GPL(pci_create_slot); | 175 | EXPORT_SYMBOL_GPL(pci_create_slot); |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * pci_update_slot_number - update %struct pci_slot -> number | 178 | * pci_renumber_slot - update %struct pci_slot -> number |
179 | * @slot - %struct pci_slot to update | 179 | * @slot - %struct pci_slot to update |
180 | * @slot_nr - new number for slot | 180 | * @slot_nr - new number for slot |
181 | * | 181 | * |
@@ -183,27 +183,22 @@ EXPORT_SYMBOL_GPL(pci_create_slot); | |||
183 | * created a placeholder slot in pci_create_slot() by passing a -1 as | 183 | * created a placeholder slot in pci_create_slot() by passing a -1 as |
184 | * slot_nr, to update their %struct pci_slot with the correct @slot_nr. | 184 | * slot_nr, to update their %struct pci_slot with the correct @slot_nr. |
185 | */ | 185 | */ |
186 | 186 | void pci_renumber_slot(struct pci_slot *slot, int slot_nr) | |
187 | void pci_update_slot_number(struct pci_slot *slot, int slot_nr) | ||
188 | { | 187 | { |
189 | int name_count = 0; | ||
190 | struct pci_slot *tmp; | 188 | struct pci_slot *tmp; |
191 | 189 | ||
192 | down_write(&pci_bus_sem); | 190 | down_write(&pci_bus_sem); |
193 | 191 | ||
194 | list_for_each_entry(tmp, &slot->bus->slots, list) { | 192 | list_for_each_entry(tmp, &slot->bus->slots, list) { |
195 | WARN_ON(tmp->number == slot_nr); | 193 | WARN_ON(tmp->number == slot_nr); |
196 | if (!strcmp(kobject_name(&tmp->kobj), kobject_name(&slot->kobj))) | 194 | goto out; |
197 | name_count++; | ||
198 | } | 195 | } |
199 | 196 | ||
200 | if (name_count > 1) | ||
201 | printk(KERN_WARNING "pci_update_slot_number found %d slots with the same name: %s\n", name_count, kobject_name(&slot->kobj)); | ||
202 | |||
203 | slot->number = slot_nr; | 197 | slot->number = slot_nr; |
198 | out: | ||
204 | up_write(&pci_bus_sem); | 199 | up_write(&pci_bus_sem); |
205 | } | 200 | } |
206 | EXPORT_SYMBOL_GPL(pci_update_slot_number); | 201 | EXPORT_SYMBOL_GPL(pci_renumber_slot); |
207 | 202 | ||
208 | /** | 203 | /** |
209 | * pci_destroy_slot - decrement refcount for physical PCI slot | 204 | * pci_destroy_slot - decrement refcount for physical PCI slot |