]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/pciehp_core.c
[PATCH] pciehp: reduce dependence on ACPI
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / pciehp_core.c
index df4915dbc321ca21622dd187b1a8ebc852b5bfae..e20cf8e42bd969c6f3aee9a88808d674135b5f9c 100644 (file)
@@ -23,7 +23,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com>
+ * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com>
  *
  */
 
@@ -39,7 +39,6 @@
 #include <linux/init.h>
 #include <asm/uaccess.h>
 #include "pciehp.h"
-#include "pciehprm.h"
 #include <linux/interrupt.h>
 
 /* Global variables */
@@ -381,6 +380,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
        dbg("%s: DRV_thread pid = %d\n", __FUNCTION__, current->pid);
        
        pdev = dev->port;
+       ctrl->pci_dev = pdev;
 
        rc = pcie_init(ctrl, dev,
                (php_intr_callback_t) pciehp_handle_attention_button,
@@ -392,8 +392,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
                goto err_out_free_ctrl;
        }
 
-       ctrl->pci_dev = pdev;
-
        pci_set_drvdata(pdev, ctrl);
 
        ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL);
@@ -433,16 +431,8 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
                goto err_out_free_ctrl_bus;
        }
 
-       /* Get IO, memory, and IRQ resources for new devices */
-       rc = pciehprm_find_available_resources(ctrl);
-       ctrl->add_support = !rc;
+       ctrl->add_support = 1;
        
-       if (rc) {
-               dbg("pciehprm_find_available_resources = %#x\n", rc);
-               err("unable to locate PCI configuration resources for hot plug add.\n");
-               goto err_out_free_ctrl_bus;
-       }
-
        /* Setup the slot information structures */
        rc = init_slots(ctrl);
        if (rc) {
@@ -521,18 +511,6 @@ static int pcie_start_thread(void)
        return retval;
 }
 
-static inline void __exit
-free_pciehp_res(struct pci_resource *res)
-{
-       struct pci_resource *tres;
-
-       while (res) {
-               tres = res;
-               res = res->next;
-               kfree(tres);
-       }
-}
-
 static void __exit unload_pciehpd(void)
 {
        struct pci_func *next;
@@ -546,11 +524,6 @@ static void __exit unload_pciehpd(void)
        while (ctrl) {
                cleanup_slots(ctrl);
 
-               free_pciehp_res(ctrl->io_head);
-               free_pciehp_res(ctrl->mem_head);
-               free_pciehp_res(ctrl->p_mem_head);
-               free_pciehp_res(ctrl->bus_head);
-
                kfree (ctrl->pci_bus);
 
                ctrl->hpc_ops->release_ctlr(ctrl);
@@ -564,11 +537,6 @@ static void __exit unload_pciehpd(void)
        for (loop = 0; loop < 256; loop++) {
                next = pciehp_slot_list[loop];
                while (next != NULL) {
-                       free_pciehp_res(next->io_head);
-                       free_pciehp_res(next->mem_head);
-                       free_pciehp_res(next->p_mem_head);
-                       free_pciehp_res(next->bus_head);
-
                        TempSlot = next;
                        next = next->next;
                        kfree(TempSlot);
@@ -639,21 +607,16 @@ static int __init pcied_init(void)
        if (retval)
                goto error_hpc_init;
 
-       retval = pciehprm_init(PCI);
-       if (!retval) {
-               retval = pcie_port_service_register(&hpdriver_portdrv);
-               dbg("pcie_port_service_register = %d\n", retval);
-               info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
-               if (retval)
-                  dbg("%s: Failure to register service\n", __FUNCTION__);
-       }
+       retval = pcie_port_service_register(&hpdriver_portdrv);
+       dbg("pcie_port_service_register = %d\n", retval);
+       info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
+       if (retval)
+               dbg("%s: Failure to register service\n", __FUNCTION__);
 
 error_hpc_init:
        if (retval) {
-               pciehprm_cleanup();
                pciehp_event_stop_thread();
-       } else
-               pciehprm_print_pirt();
+       };
 
        return retval;
 }
@@ -663,8 +626,6 @@ static void __exit pcied_cleanup(void)
        dbg("unload_pciehpd()\n");
        unload_pciehpd();
 
-       pciehprm_cleanup();
-
        dbg("pcie_port_service_unregister\n");
        pcie_port_service_unregister(&hpdriver_portdrv);