aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/rpaphp_pci.c
diff options
context:
space:
mode:
authorJohn Rose <johnrose@austin.ibm.com>2005-07-25 11:16:37 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 17:57:22 -0400
commitbde168412440084e649e7e04938bd1ab6e7bf978 (patch)
tree8d835e6dd4147db7568e070fa4cdf3e2785e3ce5 /drivers/pci/hotplug/rpaphp_pci.c
parent1b11d78cf87a7014f96e5b7fa2e1233cc8081a00 (diff)
[PATCH] PCI Hotplug: rpaphp: Remove unused stuff
Subject line says it all :) Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/rpaphp_pci.c')
-rw-r--r--drivers/pci/hotplug/rpaphp_pci.c98
1 files changed, 31 insertions, 67 deletions
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index d8305a935aab..ab67d3d1a59c 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -186,39 +186,6 @@ rpaphp_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
186 } 186 }
187} 187}
188 188
189static int rpaphp_pci_config_bridge(struct pci_dev *dev);
190
191/*****************************************************************************
192 rpaphp_pci_config_slot() will configure all devices under the
193 given slot->dn and return the the first pci_dev.
194 *****************************************************************************/
195static struct pci_dev *
196rpaphp_pci_config_slot(struct device_node *dn, struct pci_bus *bus)
197{
198 struct device_node *eads_first_child = dn->child;
199 struct pci_dev *dev = NULL;
200 int num;
201
202 dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name);
203
204 if (eads_first_child) {
205 /* pci_scan_slot should find all children of EADs */
206 num = pci_scan_slot(bus, PCI_DEVFN(PCI_SLOT(eads_first_child->devfn), 0));
207 if (num) {
208 rpaphp_fixup_new_pci_devices(bus, 1);
209 pci_bus_add_devices(bus);
210 }
211 dev = rpaphp_find_pci_dev(eads_first_child);
212 if (!dev) {
213 err("No new device found\n");
214 return NULL;
215 }
216 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
217 rpaphp_pci_config_bridge(dev);
218 }
219 return dev;
220}
221
222static int rpaphp_pci_config_bridge(struct pci_dev *dev) 189static int rpaphp_pci_config_bridge(struct pci_dev *dev)
223{ 190{
224 u8 sec_busno; 191 u8 sec_busno;
@@ -252,6 +219,37 @@ static int rpaphp_pci_config_bridge(struct pci_dev *dev)
252 return 0; 219 return 0;
253} 220}
254 221
222/*****************************************************************************
223 rpaphp_pci_config_slot() will configure all devices under the
224 given slot->dn and return the the first pci_dev.
225 *****************************************************************************/
226static struct pci_dev *
227rpaphp_pci_config_slot(struct device_node *dn, struct pci_bus *bus)
228{
229 struct device_node *eads_first_child = dn->child;
230 struct pci_dev *dev = NULL;
231 int num;
232
233 dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name);
234
235 if (eads_first_child) {
236 /* pci_scan_slot should find all children of EADs */
237 num = pci_scan_slot(bus, PCI_DEVFN(PCI_SLOT(eads_first_child->devfn), 0));
238 if (num) {
239 rpaphp_fixup_new_pci_devices(bus, 1);
240 pci_bus_add_devices(bus);
241 }
242 dev = rpaphp_find_pci_dev(eads_first_child);
243 if (!dev) {
244 err("No new device found\n");
245 return NULL;
246 }
247 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
248 rpaphp_pci_config_bridge(dev);
249 }
250 return dev;
251}
252
255static void enable_eeh(struct device_node *dn) 253static void enable_eeh(struct device_node *dn)
256{ 254{
257 struct device_node *sib; 255 struct device_node *sib;
@@ -502,37 +500,3 @@ exit:
502 dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval); 500 dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
503 return retval; 501 return retval;
504} 502}
505
506struct hotplug_slot *rpaphp_find_hotplug_slot(struct pci_dev *dev)
507{
508 struct list_head *tmp, *n;
509 struct slot *slot;
510
511 list_for_each_safe(tmp, n, &rpaphp_slot_head) {
512 struct pci_bus *bus;
513 struct list_head *ln;
514
515 slot = list_entry(tmp, struct slot, rpaphp_slot_list);
516 if (slot->bridge == NULL) {
517 if (slot->dev_type == PCI_DEV) {
518 printk(KERN_WARNING "PCI slot missing bridge %s %s \n",
519 slot->name, slot->location);
520 }
521 continue;
522 }
523
524 bus = slot->bridge->subordinate;
525 if (!bus) {
526 continue; /* should never happen? */
527 }
528 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
529 struct pci_dev *pdev = pci_dev_b(ln);
530 if (pdev == dev)
531 return slot->hotplug_slot;
532 }
533 }
534
535 return NULL;
536}
537
538EXPORT_SYMBOL_GPL(rpaphp_find_hotplug_slot);