aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Chiang <achiang@hp.com>2008-10-20 19:40:47 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-10-22 19:42:37 -0400
commitd25b7c8d6ba2735602003d75a28894772fe8ad6a (patch)
tree9804e12987fbcee2d03d277c2527670b359748a1
parent1359f2701b96abd9bb69c1273fb995a093b6409a (diff)
PCI: rename pci_update_slot_number to pci_renumber_slot
The GPL exported symbol pci_update_slot_number has been renamed to pci_renumber_slot. Some of the safety checks were unnecessary and were removed. Cc: kristen.c.accardi@intel.com Cc: matthew@wil.cx Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/slot.c15
-rw-r--r--include/linux/pci.h2
2 files changed, 6 insertions, 11 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:
175EXPORT_SYMBOL_GPL(pci_create_slot); 175EXPORT_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 186void pci_renumber_slot(struct pci_slot *slot, int slot_nr)
187void 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;
198out:
204 up_write(&pci_bus_sem); 199 up_write(&pci_bus_sem);
205} 200}
206EXPORT_SYMBOL_GPL(pci_update_slot_number); 201EXPORT_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
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ee2fd6304e05..41717ae9807e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -512,7 +512,7 @@ struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
512struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, 512struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
513 const char *name); 513 const char *name);
514void pci_destroy_slot(struct pci_slot *slot); 514void pci_destroy_slot(struct pci_slot *slot);
515void pci_update_slot_number(struct pci_slot *slot, int slot_nr); 515void pci_renumber_slot(struct pci_slot *slot, int slot_nr);
516int pci_scan_slot(struct pci_bus *bus, int devfn); 516int pci_scan_slot(struct pci_bus *bus, int devfn);
517struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 517struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
518void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 518void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);