diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-01-26 02:04:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 23:35:12 +0100 |
commit | bbe779db9f97e1c99b3c7ce1ebb26bbaecbdb2a9 (patch) | |
tree | c24d816da4873b62a4a0f29f6c39e213e5890841 /drivers/pci/hotplug/shpchp_core.c | |
parent | [PATCH] shpchp - removed unncessary 'magic' member from slot (diff) | |
download | linux-bbe779db9f97e1c99b3c7ce1ebb26bbaecbdb2a9.tar.xz linux-bbe779db9f97e1c99b3c7ce1ebb26bbaecbdb2a9.zip |
[PATCH] shpchp - move slot name into struct slot
This patch moves slot name area into struct slot.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_core.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 4161da4bf4ba..cb4ac43ea95c 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -94,12 +94,10 @@ static void release_slot(struct hotplug_slot *hotplug_slot) 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); } -#define SLOT_NAME_SIZE 10 static void make_slot_name(struct slot *slot) { snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d", @@ -111,7 +109,6 @@ static int init_slots(struct controller *ctrl) struct slot *slot; struct hotplug_slot *hotplug_slot; struct hotplug_slot_info *info; - char *name; int retval = -ENOMEM; int i; u32 sun; @@ -131,10 +128,7 @@ static int init_slots(struct controller *ctrl) goto error_hpslot; hotplug_slot->info = info; - name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); - if (!name) - goto error_info; - hotplug_slot->name = name; + hotplug_slot->name = slot->name; slot->hp_slot = i; slot->ctrl = ctrl; @@ -144,7 +138,7 @@ static int init_slots(struct controller *ctrl) if (shpchprm_get_physical_slot_number(ctrl, &sun, slot->bus, slot->device)) - goto error_name; + goto error_info; slot->number = sun; @@ -165,15 +159,13 @@ static int init_slots(struct controller *ctrl) retval = pci_hp_register(slot->hotplug_slot); if (retval) { err("pci_hp_register failed with error %d\n", retval); - goto error_name; + goto error_info; } list_add(&slot->slot_list, &ctrl->slot_list); } return 0; -error_name: - kfree(name); error_info: kfree(info); error_hpslot: |