]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/acpi/pci_link.c
[ACPI] Merge acpi-2.6.12 branch into 2.6.13-rc3
[linux-2.6.git] / drivers / acpi / pci_link.c
index a0df2f3606d35841d01e6cd3d7e756db691b16ce..26aa3829f1def0fe1d6dde66eac3bdd9cc645165 100644 (file)
@@ -786,14 +786,32 @@ end:
        return_VALUE(result);
 }
 
-static int irqrouter_suspend(struct sys_device *dev, pm_message_t state)
+static int
+acpi_pci_link_resume(
+       struct acpi_pci_link *link)
+{
+       ACPI_FUNCTION_TRACE("acpi_pci_link_resume");
+
+       if (link->refcnt && link->irq.active && link->irq.initialized)
+               return_VALUE(acpi_pci_link_set(link, link->irq.active));
+       else
+               return_VALUE(0);
+}
+
+/*
+ * FIXME: this is a workaround to avoid nasty warning.  It will be removed
+ * after every device calls pci_disable_device in .resume.
+ */
+int acpi_in_resume;
+static int
+irqrouter_resume(struct sys_device *dev)
 {
        struct list_head        *node = NULL;
        struct acpi_pci_link    *link = NULL;
-       int                     ret = 0;
 
-       ACPI_FUNCTION_TRACE("irqrouter_suspend");
+       ACPI_FUNCTION_TRACE("irqrouter_resume");
 
+       acpi_in_resume = 1;
        list_for_each(node, &acpi_link.entries) {
                link = list_entry(node, struct acpi_pci_link, node);
                if (!link) {
@@ -801,21 +819,10 @@ static int irqrouter_suspend(struct sys_device *dev, pm_message_t state)
                                "Invalid link context\n"));
                        continue;
                }
-               if (link->irq.initialized && link->refcnt != 0
-                       /* We ignore legacy IDE device irq */
-                       && link->irq.active != 14 && link->irq.active !=15) {
-                       printk(KERN_WARNING PREFIX
-                               "%d drivers with interrupt %d neglected to call"
-                               " pci_disable_device at .suspend\n",
-                               link->refcnt,
-                               link->irq.active);
-                       printk(KERN_WARNING PREFIX
-                               "Fix the driver, or rmmod before suspend\n");
-                       link->refcnt = 0;
-                       ret = -EINVAL;
-               }
+               acpi_pci_link_resume(link);
        }
-       return_VALUE(ret);
+       acpi_in_resume = 0;
+       return_VALUE(0);
 }
 
 
@@ -930,7 +937,7 @@ __setup("acpi_irq_balance", acpi_irq_balance_set);
 /* FIXME: we will remove this interface after all drivers call pci_disable_device */
 static struct sysdev_class irqrouter_sysdev_class = {
         set_kset_name("irqrouter"),
-        .suspend = irqrouter_suspend,
+        .resume = irqrouter_resume,
 };