|
@@ -587,11 +587,14 @@ static u8 calculate_first_slot (u8 slot_num)
|
|
return first_slot + 1;
|
|
return first_slot + 1;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+#define SLOT_NAME_SIZE 30
|
|
|
|
+
|
|
static char *create_file_name (struct slot * slot_cur)
|
|
static char *create_file_name (struct slot * slot_cur)
|
|
{
|
|
{
|
|
struct opt_rio *opt_vg_ptr = NULL;
|
|
struct opt_rio *opt_vg_ptr = NULL;
|
|
struct opt_rio_lo *opt_lo_ptr = NULL;
|
|
struct opt_rio_lo *opt_lo_ptr = NULL;
|
|
- static char str[30];
|
|
|
|
|
|
+ static char str[SLOT_NAME_SIZE];
|
|
int which = 0; /* rxe = 1, chassis = 0 */
|
|
int which = 0; /* rxe = 1, chassis = 0 */
|
|
u8 number = 1; /* either chassis or rxe # */
|
|
u8 number = 1; /* either chassis or rxe # */
|
|
u8 first_slot = 1;
|
|
u8 first_slot = 1;
|
|
@@ -703,7 +706,6 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
|
|
|
|
|
|
slot = hotplug_slot->private;
|
|
slot = hotplug_slot->private;
|
|
kfree(slot->hotplug_slot->info);
|
|
kfree(slot->hotplug_slot->info);
|
|
- kfree(slot->hotplug_slot->name);
|
|
|
|
kfree(slot->hotplug_slot);
|
|
kfree(slot->hotplug_slot);
|
|
slot->ctrl = NULL;
|
|
slot->ctrl = NULL;
|
|
slot->bus_on = NULL;
|
|
slot->bus_on = NULL;
|
|
@@ -734,6 +736,7 @@ static int __init ebda_rsrc_controller (void)
|
|
struct bus_info *bus_info_ptr1, *bus_info_ptr2;
|
|
struct bus_info *bus_info_ptr1, *bus_info_ptr2;
|
|
int rc;
|
|
int rc;
|
|
struct slot *tmp_slot;
|
|
struct slot *tmp_slot;
|
|
|
|
+ char name[SLOT_NAME_SIZE];
|
|
|
|
|
|
addr = hpc_list_ptr->phys_addr;
|
|
addr = hpc_list_ptr->phys_addr;
|
|
for (ctlr = 0; ctlr < hpc_list_ptr->num_ctlrs; ctlr++) {
|
|
for (ctlr = 0; ctlr < hpc_list_ptr->num_ctlrs; ctlr++) {
|
|
@@ -897,12 +900,6 @@ static int __init ebda_rsrc_controller (void)
|
|
goto error_no_hp_info;
|
|
goto error_no_hp_info;
|
|
}
|
|
}
|
|
|
|
|
|
- hp_slot_ptr->name = kmalloc(30, GFP_KERNEL);
|
|
|
|
- if (!hp_slot_ptr->name) {
|
|
|
|
- rc = -ENOMEM;
|
|
|
|
- goto error_no_hp_name;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
tmp_slot = kzalloc(sizeof(*tmp_slot), GFP_KERNEL);
|
|
tmp_slot = kzalloc(sizeof(*tmp_slot), GFP_KERNEL);
|
|
if (!tmp_slot) {
|
|
if (!tmp_slot) {
|
|
rc = -ENOMEM;
|
|
rc = -ENOMEM;
|
|
@@ -964,10 +961,9 @@ static int __init ebda_rsrc_controller (void)
|
|
} /* each hpc */
|
|
} /* each hpc */
|
|
|
|
|
|
list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
|
|
list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
|
|
- snprintf (tmp_slot->hotplug_slot->name, 30, "%s", create_file_name (tmp_slot));
|
|
|
|
|
|
+ snprintf(name, SLOT_NAME_SIZE, "%s", create_file_name(tmp_slot));
|
|
pci_hp_register(tmp_slot->hotplug_slot,
|
|
pci_hp_register(tmp_slot->hotplug_slot,
|
|
- pci_find_bus(0, tmp_slot->bus), tmp_slot->device,
|
|
|
|
- tmp_slot->hotplug_slot->name);
|
|
|
|
|
|
+ pci_find_bus(0, tmp_slot->bus), tmp_slot->device, name);
|
|
}
|
|
}
|
|
|
|
|
|
print_ebda_hpc ();
|
|
print_ebda_hpc ();
|
|
@@ -977,8 +973,6 @@ static int __init ebda_rsrc_controller (void)
|
|
error:
|
|
error:
|
|
kfree (hp_slot_ptr->private);
|
|
kfree (hp_slot_ptr->private);
|
|
error_no_slot:
|
|
error_no_slot:
|
|
- kfree (hp_slot_ptr->name);
|
|
|
|
-error_no_hp_name:
|
|
|
|
kfree (hp_slot_ptr->info);
|
|
kfree (hp_slot_ptr->info);
|
|
error_no_hp_info:
|
|
error_no_hp_info:
|
|
kfree (hp_slot_ptr);
|
|
kfree (hp_slot_ptr);
|