Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117210
b: refs/heads/master
c: d25b7c8
h: refs/heads/master
v: v3
  • Loading branch information
Alex Chiang authored and Jesse Barnes committed Oct 22, 2008
1 parent 2d491b8 commit ccb5987
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 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: 1359f2701b96abd9bb69c1273fb995a093b6409a
refs/heads/master: d25b7c8d6ba2735602003d75a28894772fe8ad6a
15 changes: 5 additions & 10 deletions trunk/drivers/pci/slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,35 +175,30 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
EXPORT_SYMBOL_GPL(pci_create_slot);

/**
* pci_update_slot_number - update %struct pci_slot -> number
* pci_renumber_slot - update %struct pci_slot -> number
* @slot - %struct pci_slot to update
* @slot_nr - new number for slot
*
* The primary purpose of this interface is to allow callers who earlier
* created a placeholder slot in pci_create_slot() by passing a -1 as
* slot_nr, to update their %struct pci_slot with the correct @slot_nr.
*/

void pci_update_slot_number(struct pci_slot *slot, int slot_nr)
void pci_renumber_slot(struct pci_slot *slot, int slot_nr)
{
int name_count = 0;
struct pci_slot *tmp;

down_write(&pci_bus_sem);

list_for_each_entry(tmp, &slot->bus->slots, list) {
WARN_ON(tmp->number == slot_nr);
if (!strcmp(kobject_name(&tmp->kobj), kobject_name(&slot->kobj)))
name_count++;
goto out;
}

if (name_count > 1)
printk(KERN_WARNING "pci_update_slot_number found %d slots with the same name: %s\n", name_count, kobject_name(&slot->kobj));

slot->number = slot_nr;
out:
up_write(&pci_bus_sem);
}
EXPORT_SYMBOL_GPL(pci_update_slot_number);
EXPORT_SYMBOL_GPL(pci_renumber_slot);

/**
* pci_destroy_slot - decrement refcount for physical PCI slot
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
const char *name);
void pci_destroy_slot(struct pci_slot *slot);
void pci_update_slot_number(struct pci_slot *slot, int slot_nr);
void pci_renumber_slot(struct pci_slot *slot, int slot_nr);
int pci_scan_slot(struct pci_bus *bus, int devfn);
struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
Expand Down

0 comments on commit ccb5987

Please sign in to comment.