aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorlinas@austin.ibm.com <linas@austin.ibm.com>2006-01-12 19:22:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-31 21:00:12 -0500
commit7fec77e4793f307b30846a3d4015d329ffc0b685 (patch)
treee9a3004bbf45237063ce7dfbc28e32e1c53ac938 /drivers/pci
parenteca845c71816669dace4bf1954d9ab276abb0002 (diff)
[PATCH] powerpc/PCI hotplug: merge config_pci_adapter
Remove general baroqueness. The function rpaphp_config_pci_adapter() is really just one line of code, once all the dbg printks are removed. And its called in only one place. So replace the call by the one line. 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')
-rw-r--r--drivers/pci/hotplug/rpaphp.h1
-rw-r--r--drivers/pci/hotplug/rpaphp_pci.c35
2 files changed, 4 insertions, 32 deletions
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 6aa91ef5cd70..89d705c7c502 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -92,7 +92,6 @@ extern int rpaphp_enable_pci_slot(struct slot *slot);
92extern int register_pci_slot(struct slot *slot); 92extern int 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);
94 94
95extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
96extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus); 95extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
97 96
98/* rpaphp_core.c */ 97/* rpaphp_core.c */
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 1a12ebd10e34..b93d9c964eea 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -116,24 +116,6 @@ static void print_slot_pci_funcs(struct pci_bus *bus)
116 return; 116 return;
117} 117}
118 118
119int rpaphp_config_pci_adapter(struct pci_bus *bus)
120{
121 struct device_node *dn = pci_bus_to_OF_node(bus);
122 int rc = -ENODEV;
123
124 dbg("Entry %s: slot[%s]\n", __FUNCTION__, dn->full_name);
125 if (!dn)
126 goto exit;
127
128 pcibios_add_pci_devices(bus);
129 print_slot_pci_funcs(bus);
130 rc = 0;
131exit:
132 dbg("Exit %s: rc=%d\n", __FUNCTION__, rc);
133 return rc;
134}
135EXPORT_SYMBOL_GPL(rpaphp_config_pci_adapter);
136
137static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev) 119static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
138{ 120{
139 eeh_remove_device(dev); 121 eeh_remove_device(dev);
@@ -225,10 +207,7 @@ static int setup_pci_slot(struct slot *slot)
225 if (slot->hotplug_slot->info->adapter_status == NOT_CONFIGURED) { 207 if (slot->hotplug_slot->info->adapter_status == NOT_CONFIGURED) {
226 dbg("%s CONFIGURING pci adapter in slot[%s]\n", 208 dbg("%s CONFIGURING pci adapter in slot[%s]\n",
227 __FUNCTION__, slot->name); 209 __FUNCTION__, slot->name);
228 if (rpaphp_config_pci_adapter(slot->bus)) { 210 pcibios_add_pci_devices(slot->bus);
229 err("%s: CONFIG pci adapter failed\n", __FUNCTION__);
230 goto exit_rc;
231 }
232 211
233 } else if (slot->hotplug_slot->info->adapter_status != CONFIGURED) { 212 } else if (slot->hotplug_slot->info->adapter_status != CONFIGURED) {
234 err("%s: slot[%s]'s adapter_status is NOT_VALID.\n", 213 err("%s: slot[%s]'s adapter_status is NOT_VALID.\n",
@@ -274,16 +253,10 @@ int rpaphp_enable_pci_slot(struct slot *slot)
274 /* if slot is not empty, enable the adapter */ 253 /* if slot is not empty, enable the adapter */
275 if (state == PRESENT) { 254 if (state == PRESENT) {
276 dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name); 255 dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name);
277 retval = rpaphp_config_pci_adapter(slot->bus); 256 pcibios_add_pci_devices(slot->bus);
278 if (!retval) { 257 slot->state = CONFIGURED;
279 slot->state = CONFIGURED; 258 info("%s: devices in slot[%s] configured\n",
280 info("%s: devices in slot[%s] configured\n",
281 __FUNCTION__, slot->name); 259 __FUNCTION__, slot->name);
282 } else {
283 slot->state = NOT_CONFIGURED;
284 dbg("%s: no pci_dev struct for adapter in slot[%s]\n",
285 __FUNCTION__, slot->name);
286 }
287 } else if (state == EMPTY) { 260 } else if (state == EMPTY) {
288 dbg("%s : slot[%s] is empty\n", __FUNCTION__, slot->name); 261 dbg("%s : slot[%s] is empty\n", __FUNCTION__, slot->name);
289 slot->state = EMPTY; 262 slot->state = EMPTY;