Commit 6b5561f4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] PCI Hotplug: change pci_hp_change_slot_info() to take a hotplug_slot and not a string.

parent d7ef941b
......@@ -130,7 +130,7 @@ update_latch_status(struct hotplug_slot *hotplug_slot, u8 value)
return -EINVAL;
memcpy(&info, hotplug_slot->info, sizeof(struct hotplug_slot_info));
info.latch_status = value;
return pci_hp_change_slot_info(hotplug_slot->name, &info);
return pci_hp_change_slot_info(hotplug_slot, &info);
}
static int
......@@ -142,7 +142,7 @@ update_adapter_status(struct hotplug_slot *hotplug_slot, u8 value)
return -EINVAL;
memcpy(&info, hotplug_slot->info, sizeof(struct hotplug_slot_info));
info.adapter_status = value;
return pci_hp_change_slot_info(hotplug_slot->name, &info);
return pci_hp_change_slot_info(hotplug_slot, &info);
}
static int
......
......@@ -1767,19 +1767,17 @@ void cpqhp_event_stop_thread (void)
static int update_slot_info (struct controller *ctrl, struct slot *slot)
{
struct hotplug_slot_info *info;
char buffer[SLOT_NAME_SIZE];
int result;
info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
make_slot_name (&buffer[0], SLOT_NAME_SIZE, slot);
info->power_status = get_slot_enabled(ctrl, slot);
info->attention_status = cpq_get_attention_status(ctrl, slot);
info->latch_status = cpq_get_latch_status(ctrl, slot);
info->adapter_status = get_presence_status(ctrl, slot);
result = pci_hp_change_slot_info(buffer, info);
result = pci_hp_change_slot_info(slot->hotplug_slot, info);
kfree (info);
return result;
}
......
......@@ -686,7 +686,6 @@ static int validate (struct slot *slot_cur, int opn)
int ibmphp_update_slot_info (struct slot *slot_cur)
{
struct hotplug_slot_info *info;
char buffer[30];
int rc;
u8 bus_speed;
u8 mode;
......@@ -697,7 +696,6 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
return -ENOMEM;
}
strncpy (buffer, slot_cur->hotplug_slot->name, 30);
info->power_status = SLOT_PWRGD (slot_cur->status);
info->attention_status = SLOT_ATTN (slot_cur->status, slot_cur->ext_status);
info->latch_status = SLOT_LATCH (slot_cur->status);
......@@ -735,7 +733,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
info->max_bus_speed = slot_cur->hotplug_slot->info->max_bus_speed;
// To do: bus_names
rc = pci_hp_change_slot_info (buffer, info);
rc = pci_hp_change_slot_info (slot_cur->hotplug_slot, info);
kfree (info);
return rc;
}
......
......@@ -139,7 +139,7 @@ struct hotplug_slot {
extern int pci_hp_register (struct hotplug_slot *slot);
extern int pci_hp_deregister (struct hotplug_slot *slot);
extern int pci_hp_change_slot_info (const char *name,
extern int pci_hp_change_slot_info (struct hotplug_slot *slot,
struct hotplug_slot_info *info);
struct pci_dev_wrapped {
......
......@@ -529,16 +529,16 @@ int pci_hp_deregister (struct hotplug_slot *slot)
/**
* pci_hp_change_slot_info - changes the slot's information structure in the core
* @name: the name of the slot whose info has changed
* @slot: pointer to the slot whose info has changed
* @info: pointer to the info copy into the slot's info structure
*
* A slot with @name must have been registered with the pci
* @slot must have been registered with the pci
* hotplug subsystem previously with a call to pci_hp_register().
*
* Returns 0 if successful, anything else for an error.
* Not supported by sysfs now.
*/
int pci_hp_change_slot_info (const char *name, struct hotplug_slot_info *info)
int pci_hp_change_slot_info (struct hotplug_slot *slot, struct hotplug_slot_info *info)
{
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment