Commit f6afbad8 authored by linas@austin.ibm.com's avatar linas@austin.ibm.com Committed by Greg Kroah-Hartman

[PATCH] powerpc/PCI hotplug: cleanup: add prefix

Minor cleanup. Add the prefix rpaphp_* to several generic-sounding routines.
Remove rpaphp_remove_slot(), which is a one-liner.
Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>
Acked-by: default avatarJohn Rose <johnrose@austin.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e06b80b7
...@@ -227,7 +227,7 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn) ...@@ -227,7 +227,7 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
slot = find_slot(dn); slot = find_slot(dn);
if (slot) { if (slot) {
/* Remove hotplug slot */ /* Remove hotplug slot */
if (rpaphp_remove_slot(slot)) { if (rpaphp_deregister_slot(slot)) {
printk(KERN_ERR printk(KERN_ERR
"%s: unable to remove hotplug slot %s\n", "%s: unable to remove hotplug slot %s\n",
__FUNCTION__, drc_name); __FUNCTION__, drc_name);
...@@ -373,7 +373,7 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn) ...@@ -373,7 +373,7 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
slot = find_slot(dn); slot = find_slot(dn);
if (slot) { if (slot) {
/* Remove hotplug slot */ /* Remove hotplug slot */
if (rpaphp_remove_slot(slot)) { if (rpaphp_deregister_slot(slot)) {
printk(KERN_ERR printk(KERN_ERR
"%s: unable to remove hotplug slot %s\n", "%s: unable to remove hotplug slot %s\n",
__FUNCTION__, drc_name); __FUNCTION__, drc_name);
......
...@@ -89,7 +89,7 @@ extern int num_slots; ...@@ -89,7 +89,7 @@ extern int num_slots;
/* rpaphp_pci.c */ /* rpaphp_pci.c */
extern int rpaphp_enable_pci_slot(struct slot *slot); extern int rpaphp_enable_pci_slot(struct slot *slot);
extern int register_pci_slot(struct slot *slot); extern int rpaphp_register_pci_slot(struct slot *slot);
extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
extern int rpaphp_get_sensor_state(struct slot *slot, int *state); extern int rpaphp_get_sensor_state(struct slot *slot, int *state);
...@@ -102,8 +102,8 @@ extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, ...@@ -102,8 +102,8 @@ extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
/* rpaphp_slot.c */ /* rpaphp_slot.c */
extern void dealloc_slot_struct(struct slot *slot); extern void dealloc_slot_struct(struct slot *slot);
extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
extern int register_slot(struct slot *slot); extern int rpaphp_register_slot(struct slot *slot);
extern int deregister_slot(struct slot *slot); extern int rpaphp_deregister_slot(struct slot *slot);
extern int rpaphp_get_power_status(struct slot *slot, u8 * value); extern int rpaphp_get_power_status(struct slot *slot, u8 * value);
extern int rpaphp_set_attention_status(struct slot *slot, u8 status); extern int rpaphp_set_attention_status(struct slot *slot, u8 status);
......
...@@ -196,11 +196,6 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe ...@@ -196,11 +196,6 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
return 0; return 0;
} }
int rpaphp_remove_slot(struct slot *slot)
{
return deregister_slot(slot);
}
static int get_children_props(struct device_node *dn, int **drc_indexes, static int get_children_props(struct device_node *dn, int **drc_indexes,
int **drc_names, int **drc_types, int **drc_power_domains) int **drc_names, int **drc_types, int **drc_power_domains)
{ {
...@@ -307,13 +302,15 @@ static int is_php_dn(struct device_node *dn, int **indexes, int **names, ...@@ -307,13 +302,15 @@ static int is_php_dn(struct device_node *dn, int **indexes, int **names,
return 0; return 0;
} }
/**************************************************************** /**
* rpaphp_add_slot -- add hotplug or dlpar slot
*
* rpaphp not only registers PCI hotplug slots(HOTPLUG), * rpaphp not only registers PCI hotplug slots(HOTPLUG),
* but also logical DR slots(EMBEDDED). * but also logical DR slots(EMBEDDED).
* HOTPLUG slot: An adapter can be physically added/removed. * HOTPLUG slot: An adapter can be physically added/removed.
* EMBEDDED slot: An adapter can be logically removed/added * EMBEDDED slot: An adapter can be logically removed/added
* from/to a partition with the slot. * from/to a partition with the slot.
***************************************************************/ */
int rpaphp_add_slot(struct device_node *dn) int rpaphp_add_slot(struct device_node *dn)
{ {
struct slot *slot; struct slot *slot;
...@@ -344,7 +341,7 @@ int rpaphp_add_slot(struct device_node *dn) ...@@ -344,7 +341,7 @@ int rpaphp_add_slot(struct device_node *dn)
dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n", dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
indexes[i + 1], name, type); indexes[i + 1], name, type);
retval = register_pci_slot(slot); retval = rpaphp_register_pci_slot(slot);
} }
} }
exit: exit:
...@@ -462,6 +459,5 @@ module_init(rpaphp_init); ...@@ -462,6 +459,5 @@ module_init(rpaphp_init);
module_exit(rpaphp_exit); module_exit(rpaphp_exit);
EXPORT_SYMBOL_GPL(rpaphp_add_slot); EXPORT_SYMBOL_GPL(rpaphp_add_slot);
EXPORT_SYMBOL_GPL(rpaphp_remove_slot);
EXPORT_SYMBOL_GPL(rpaphp_slot_head); EXPORT_SYMBOL_GPL(rpaphp_slot_head);
EXPORT_SYMBOL_GPL(rpaphp_get_drc_props); EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);
...@@ -199,7 +199,7 @@ static int setup_pci_slot(struct slot *slot) ...@@ -199,7 +199,7 @@ static int setup_pci_slot(struct slot *slot)
return -EINVAL; return -EINVAL;
} }
int register_pci_slot(struct slot *slot) int rpaphp_register_pci_slot(struct slot *slot)
{ {
int rc = -EINVAL; int rc = -EINVAL;
...@@ -207,7 +207,7 @@ int register_pci_slot(struct slot *slot) ...@@ -207,7 +207,7 @@ int register_pci_slot(struct slot *slot)
goto exit_rc; goto exit_rc;
if (setup_pci_slot(slot)) if (setup_pci_slot(slot))
goto exit_rc; goto exit_rc;
rc = register_slot(slot); rc = rpaphp_register_slot(slot);
exit_rc: exit_rc:
return rc; return rc;
} }
......
...@@ -137,7 +137,7 @@ static int is_registered(struct slot *slot) ...@@ -137,7 +137,7 @@ static int is_registered(struct slot *slot)
return 0; return 0;
} }
int deregister_slot(struct slot *slot) int rpaphp_deregister_slot(struct slot *slot)
{ {
int retval = 0; int retval = 0;
struct hotplug_slot *php_slot = slot->hotplug_slot; struct hotplug_slot *php_slot = slot->hotplug_slot;
...@@ -160,7 +160,7 @@ int deregister_slot(struct slot *slot) ...@@ -160,7 +160,7 @@ int deregister_slot(struct slot *slot)
return retval; return retval;
} }
int register_slot(struct slot *slot) int rpaphp_register_slot(struct slot *slot)
{ {
int retval; int retval;
...@@ -169,7 +169,7 @@ int register_slot(struct slot *slot) ...@@ -169,7 +169,7 @@ int register_slot(struct slot *slot)
slot->power_domain, slot->type); slot->power_domain, slot->type);
/* should not try to register the same slot twice */ /* should not try to register the same slot twice */
if (is_registered(slot)) { /* should't be here */ if (is_registered(slot)) { /* should't be here */
err("register_slot: slot[%s] is already registered\n", slot->name); err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name);
rpaphp_release_slot(slot->hotplug_slot); rpaphp_release_slot(slot->hotplug_slot);
return -EAGAIN; return -EAGAIN;
} }
......
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