aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorlinas@austin.ibm.com <linas@austin.ibm.com>2006-01-12 19:31:01 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-31 21:00:13 -0500
commitf6afbad82c6b7bab0198442592b110341fb419ba (patch)
tree6a444ff2b09cc08e93f6f2825b6cfc5e507a029e /drivers/pci/hotplug
parente06b80b78db96ca272db4ec0b26ce1092a1a9704 (diff)
[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: Linas Vepstas <linas@austin.ibm.com> Acked-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/rpadlpar_core.c4
-rw-r--r--drivers/pci/hotplug/rpaphp.h6
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c14
-rw-r--r--drivers/pci/hotplug/rpaphp_pci.c4
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c16
5 files changed, 20 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 15e853e5e689..d3aa9df1acd4 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -227,7 +227,7 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
227 slot = find_slot(dn); 227 slot = find_slot(dn);
228 if (slot) { 228 if (slot) {
229 /* Remove hotplug slot */ 229 /* Remove hotplug slot */
230 if (rpaphp_remove_slot(slot)) { 230 if (rpaphp_deregister_slot(slot)) {
231 printk(KERN_ERR 231 printk(KERN_ERR
232 "%s: unable to remove hotplug slot %s\n", 232 "%s: unable to remove hotplug slot %s\n",
233 __FUNCTION__, drc_name); 233 __FUNCTION__, drc_name);
@@ -373,7 +373,7 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
373 slot = find_slot(dn); 373 slot = find_slot(dn);
374 if (slot) { 374 if (slot) {
375 /* Remove hotplug slot */ 375 /* Remove hotplug slot */
376 if (rpaphp_remove_slot(slot)) { 376 if (rpaphp_deregister_slot(slot)) {
377 printk(KERN_ERR 377 printk(KERN_ERR
378 "%s: unable to remove hotplug slot %s\n", 378 "%s: unable to remove hotplug slot %s\n",
379 __FUNCTION__, drc_name); 379 __FUNCTION__, drc_name);
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 095c9aacaa16..310b6186c0e5 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -89,7 +89,7 @@ extern int num_slots;
89 89
90/* rpaphp_pci.c */ 90/* rpaphp_pci.c */
91extern int rpaphp_enable_pci_slot(struct slot *slot); 91extern int rpaphp_enable_pci_slot(struct slot *slot);
92extern int register_pci_slot(struct slot *slot); 92extern int rpaphp_register_pci_slot(struct slot *slot);
93extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); 93extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
94extern int rpaphp_get_sensor_state(struct slot *slot, int *state); 94extern int rpaphp_get_sensor_state(struct slot *slot, int *state);
95 95
@@ -102,8 +102,8 @@ extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
102/* rpaphp_slot.c */ 102/* rpaphp_slot.c */
103extern void dealloc_slot_struct(struct slot *slot); 103extern void dealloc_slot_struct(struct slot *slot);
104extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); 104extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
105extern int register_slot(struct slot *slot); 105extern int rpaphp_register_slot(struct slot *slot);
106extern int deregister_slot(struct slot *slot); 106extern int rpaphp_deregister_slot(struct slot *slot);
107extern int rpaphp_get_power_status(struct slot *slot, u8 * value); 107extern int rpaphp_get_power_status(struct slot *slot, u8 * value);
108extern int rpaphp_set_attention_status(struct slot *slot, u8 status); 108extern int rpaphp_set_attention_status(struct slot *slot, u8 status);
109 109
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 341fdd59090b..c0e521c8f9ef 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -196,11 +196,6 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
196 return 0; 196 return 0;
197} 197}
198 198
199int rpaphp_remove_slot(struct slot *slot)
200{
201 return deregister_slot(slot);
202}
203
204static int get_children_props(struct device_node *dn, int **drc_indexes, 199static int get_children_props(struct device_node *dn, int **drc_indexes,
205 int **drc_names, int **drc_types, int **drc_power_domains) 200 int **drc_names, int **drc_types, int **drc_power_domains)
206{ 201{
@@ -307,13 +302,15 @@ static int is_php_dn(struct device_node *dn, int **indexes, int **names,
307 return 0; 302 return 0;
308} 303}
309 304
310/**************************************************************** 305/**
306 * rpaphp_add_slot -- add hotplug or dlpar slot
307 *
311 * rpaphp not only registers PCI hotplug slots(HOTPLUG), 308 * rpaphp not only registers PCI hotplug slots(HOTPLUG),
312 * but also logical DR slots(EMBEDDED). 309 * but also logical DR slots(EMBEDDED).
313 * HOTPLUG slot: An adapter can be physically added/removed. 310 * HOTPLUG slot: An adapter can be physically added/removed.
314 * EMBEDDED slot: An adapter can be logically removed/added 311 * EMBEDDED slot: An adapter can be logically removed/added
315 * from/to a partition with the slot. 312 * from/to a partition with the slot.
316 ***************************************************************/ 313 */
317int rpaphp_add_slot(struct device_node *dn) 314int rpaphp_add_slot(struct device_node *dn)
318{ 315{
319 struct slot *slot; 316 struct slot *slot;
@@ -344,7 +341,7 @@ int rpaphp_add_slot(struct device_node *dn)
344 dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n", 341 dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
345 indexes[i + 1], name, type); 342 indexes[i + 1], name, type);
346 343
347 retval = register_pci_slot(slot); 344 retval = rpaphp_register_pci_slot(slot);
348 } 345 }
349 } 346 }
350exit: 347exit:
@@ -462,6 +459,5 @@ module_init(rpaphp_init);
462module_exit(rpaphp_exit); 459module_exit(rpaphp_exit);
463 460
464EXPORT_SYMBOL_GPL(rpaphp_add_slot); 461EXPORT_SYMBOL_GPL(rpaphp_add_slot);
465EXPORT_SYMBOL_GPL(rpaphp_remove_slot);
466EXPORT_SYMBOL_GPL(rpaphp_slot_head); 462EXPORT_SYMBOL_GPL(rpaphp_slot_head);
467EXPORT_SYMBOL_GPL(rpaphp_get_drc_props); 463EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index d1297d070a75..6f6cbede5135 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -199,7 +199,7 @@ exit_rc:
199 return -EINVAL; 199 return -EINVAL;
200} 200}
201 201
202int register_pci_slot(struct slot *slot) 202int rpaphp_register_pci_slot(struct slot *slot)
203{ 203{
204 int rc = -EINVAL; 204 int rc = -EINVAL;
205 205
@@ -207,7 +207,7 @@ int register_pci_slot(struct slot *slot)
207 goto exit_rc; 207 goto exit_rc;
208 if (setup_pci_slot(slot)) 208 if (setup_pci_slot(slot))
209 goto exit_rc; 209 goto exit_rc;
210 rc = register_slot(slot); 210 rc = rpaphp_register_slot(slot);
211exit_rc: 211exit_rc:
212 return rc; 212 return rc;
213} 213}
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index daa89ae57123..04cc1e7275ce 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -35,16 +35,16 @@
35 35
36static ssize_t location_read_file (struct hotplug_slot *php_slot, char *buf) 36static ssize_t location_read_file (struct hotplug_slot *php_slot, char *buf)
37{ 37{
38 char *value; 38 char *value;
39 int retval = -ENOENT; 39 int retval = -ENOENT;
40 struct slot *slot = (struct slot *)php_slot->private; 40 struct slot *slot = (struct slot *)php_slot->private;
41 41
42 if (!slot) 42 if (!slot)
43 return retval; 43 return retval;
44 44
45 value = slot->location; 45 value = slot->location;
46 retval = sprintf (buf, "%s\n", value); 46 retval = sprintf (buf, "%s\n", value);
47 return retval; 47 return retval;
48} 48}
49 49
50static struct hotplug_slot_attribute hotplug_slot_attr_location = { 50static struct hotplug_slot_attribute hotplug_slot_attr_location = {
@@ -137,7 +137,7 @@ static int is_registered(struct slot *slot)
137 return 0; 137 return 0;
138} 138}
139 139
140int deregister_slot(struct slot *slot) 140int rpaphp_deregister_slot(struct slot *slot)
141{ 141{
142 int retval = 0; 142 int retval = 0;
143 struct hotplug_slot *php_slot = slot->hotplug_slot; 143 struct hotplug_slot *php_slot = slot->hotplug_slot;
@@ -160,7 +160,7 @@ int deregister_slot(struct slot *slot)
160 return retval; 160 return retval;
161} 161}
162 162
163int register_slot(struct slot *slot) 163int rpaphp_register_slot(struct slot *slot)
164{ 164{
165 int retval; 165 int retval;
166 166
@@ -169,7 +169,7 @@ int register_slot(struct slot *slot)
169 slot->power_domain, slot->type); 169 slot->power_domain, slot->type);
170 /* should not try to register the same slot twice */ 170 /* should not try to register the same slot twice */
171 if (is_registered(slot)) { /* should't be here */ 171 if (is_registered(slot)) { /* should't be here */
172 err("register_slot: slot[%s] is already registered\n", slot->name); 172 err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name);
173 rpaphp_release_slot(slot->hotplug_slot); 173 rpaphp_release_slot(slot->hotplug_slot);
174 return -EAGAIN; 174 return -EAGAIN;
175 } 175 }