diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-28 11:26:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-28 11:26:12 -0400 |
commit | 7a9787e1eba95a166265e6a260cf30af04ef0a99 (patch) | |
tree | e730a4565e0318140d2fbd2f0415d18a339d7336 /drivers/pci/hotplug/rpaphp_slot.c | |
parent | 41b9eb264c8407655db57b60b4457fe1b2ec9977 (diff) | |
parent | 0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff) |
Merge commit 'v2.6.28-rc2' into x86/pci-ioapic-boot-irq-quirks
Diffstat (limited to 'drivers/pci/hotplug/rpaphp_slot.c')
-rw-r--r-- | drivers/pci/hotplug/rpaphp_slot.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c index 9b714ea93d2..2ea9cf1a8d0 100644 --- a/drivers/pci/hotplug/rpaphp_slot.c +++ b/drivers/pci/hotplug/rpaphp_slot.c | |||
@@ -43,7 +43,7 @@ static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot) | |||
43 | void dealloc_slot_struct(struct slot *slot) | 43 | void dealloc_slot_struct(struct slot *slot) |
44 | { | 44 | { |
45 | kfree(slot->hotplug_slot->info); | 45 | kfree(slot->hotplug_slot->info); |
46 | kfree(slot->hotplug_slot->name); | 46 | kfree(slot->name); |
47 | kfree(slot->hotplug_slot); | 47 | kfree(slot->hotplug_slot); |
48 | kfree(slot); | 48 | kfree(slot); |
49 | } | 49 | } |
@@ -63,11 +63,9 @@ struct slot *alloc_slot_struct(struct device_node *dn, | |||
63 | GFP_KERNEL); | 63 | GFP_KERNEL); |
64 | if (!slot->hotplug_slot->info) | 64 | if (!slot->hotplug_slot->info) |
65 | goto error_hpslot; | 65 | goto error_hpslot; |
66 | slot->hotplug_slot->name = kmalloc(strlen(drc_name) + 1, GFP_KERNEL); | 66 | slot->name = kstrdup(drc_name, GFP_KERNEL); |
67 | if (!slot->hotplug_slot->name) | 67 | if (!slot->name) |
68 | goto error_info; | 68 | goto error_info; |
69 | slot->name = slot->hotplug_slot->name; | ||
70 | strcpy(slot->name, drc_name); | ||
71 | slot->dn = dn; | 69 | slot->dn = dn; |
72 | slot->index = drc_index; | 70 | slot->index = drc_index; |
73 | slot->power_domain = power_domain; | 71 | slot->power_domain = power_domain; |
@@ -137,7 +135,7 @@ int rpaphp_register_slot(struct slot *slot) | |||
137 | slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); | 135 | slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); |
138 | else | 136 | else |
139 | slotno = -1; | 137 | slotno = -1; |
140 | retval = pci_hp_register(php_slot, slot->bus, slotno); | 138 | retval = pci_hp_register(php_slot, slot->bus, slotno, slot->name); |
141 | if (retval) { | 139 | if (retval) { |
142 | err("pci_hp_register failed with error %d\n", retval); | 140 | err("pci_hp_register failed with error %d\n", retval); |
143 | return retval; | 141 | return retval; |
@@ -147,9 +145,5 @@ int rpaphp_register_slot(struct slot *slot) | |||
147 | list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); | 145 | list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); |
148 | info("Slot [%s] registered\n", slot->name); | 146 | info("Slot [%s] registered\n", slot->name); |
149 | return 0; | 147 | return 0; |
150 | |||
151 | sysfs_fail: | ||
152 | pci_hp_deregister(php_slot); | ||
153 | return retval; | ||
154 | } | 148 | } |
155 | 149 | ||