aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorAlex Chiang <achiang@hp.com>2008-10-20 19:41:43 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-10-22 19:42:42 -0400
commitb2132fecca02fa05d509ba4c8c1e51dee6ccd003 (patch)
treee72d872b26c2380b3e5fc20c5ed535122c63b688 /drivers/pci
parente1acb24f059defdaa0264e925f19cc21b0a3e592 (diff)
PCI: rpaphp: kmalloc/kfree slot->name directly
rpaphp tends to use slot->name directly everywhere, and doesn't ever need slot->hotplug_slot->name. struct hotplug_slot->name is going away, so convert rpaphp directly manipulate its own slot->name everywhere, and don't bother touching slot->hotplug_slot->name. 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>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 736d3b43ed0b..2ea9cf1a8d02 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)
43void dealloc_slot_struct(struct slot *slot) 43void 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;