-struct pci_dev *rpaphp_find_pci_dev(struct device_node *dn)
-{
- struct pci_dev *retval_dev = NULL, *dev = NULL;
- char bus_id[BUS_ID_SIZE];
-
- sprintf(bus_id, "%04x:%02x:%02x.%d",dn->phb->global_number,
- dn->busno, PCI_SLOT(dn->devfn), PCI_FUNC(dn->devfn));
-
- dbg("Enter rpaphp_find_pci_dev() full_name=%s bus_id=%s\n",
- dn->full_name, bus_id);
-
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
- if (!strcmp(pci_name(dev), bus_id)) {
- retval_dev = dev;
- dbg("rpaphp_find_pci_dev(): found dev=%p\n\n", dev);
- break;
- }
- }
- return retval_dev;
-
-}
-
-EXPORT_SYMBOL_GPL(rpaphp_find_pci_dev);
-
-int rpaphp_claim_resource(struct pci_dev *dev, int resource)
-{
- struct resource *res = &dev->resource[resource];
- struct resource *root = pci_find_parent_resource(dev, res);
- char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
- int err;
-
- err = -EINVAL;
- if (root != NULL) {
- err = request_resource(root, res);
- }
-
- if (err) {
- err("PCI: %s region %d of %s %s [%lx:%lx]\n",
- root ? "Address space collision on" :
- "No parent found for",
- resource, dtype, pci_name(dev), res->start, res->end);
- }
- return err;
-}
-
-EXPORT_SYMBOL_GPL(rpaphp_claim_resource);
-
-static struct pci_dev *rpaphp_find_bridge_pdev(struct slot *slot)
-{
- return rpaphp_find_pci_dev(slot->dn);
-}
-
-static struct pci_dev *rpaphp_find_adapter_pdev(struct slot *slot)
-{
- return rpaphp_find_pci_dev(slot->dn->child);
-}
-
-static int rpaphp_get_sensor_state(struct slot *slot, int *state)