Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 861
b: refs/heads/master
c: b308240
h: refs/heads/master
i:
  859: 833eaee
v: v3
  • Loading branch information
Dely Sy authored and Greg KH committed May 4, 2005
1 parent 4470dc0 commit 65bfb8c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 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: eaae4b3a84a3781543a32bcaf0a33306ae915574
refs/heads/master: b308240b49ff5a1bddc6e10513c2c83f37a0bc78
23 changes: 18 additions & 5 deletions trunk/drivers/pci/hotplug/pciehp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ static struct hotplug_slot_ops pciehp_hotplug_slot_ops = {
.get_cur_bus_speed = get_cur_bus_speed,
};

/**
* release_slot - free up the memory used by a slot
* @hotplug_slot: slot to free
*/
static void release_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);

kfree(slot->hotplug_slot->info);
kfree(slot->hotplug_slot->name);
kfree(slot->hotplug_slot);
kfree(slot);
}

static int init_slots(struct controller *ctrl)
{
struct slot *new_slot;
Expand Down Expand Up @@ -139,7 +155,8 @@ static int init_slots(struct controller *ctrl)

/* register this slot with the hotplug pci core */
new_slot->hotplug_slot->private = new_slot;
make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
new_slot->hotplug_slot->release = &release_slot;
make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
new_slot->hotplug_slot->ops = &pciehp_hotplug_slot_ops;

new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status));
Expand Down Expand Up @@ -188,10 +205,6 @@ static int cleanup_slots (struct controller * ctrl)
while (old_slot) {
next_slot = old_slot->next;
pci_hp_deregister (old_slot->hotplug_slot);
kfree(old_slot->hotplug_slot->info);
kfree(old_slot->hotplug_slot->name);
kfree(old_slot->hotplug_slot);
kfree(old_slot);
old_slot = next_slot;
}

Expand Down

0 comments on commit 65bfb8c

Please sign in to comment.