hwmon: (adt7475) Fix temperature fault flags
[safe/jmp/linux-2.6] / drivers / pnp / pnpbios / core.c
index 6af2be2..cfe8685 100644 (file)
@@ -50,7 +50,6 @@
 #include <linux/init.h>
 #include <linux/linkage.h>
 #include <linux/kernel.h>
-#include <linux/pnpbios.h>
 #include <linux/device.h>
 #include <linux/pnp.h>
 #include <linux/mm.h>
@@ -95,7 +94,6 @@ struct pnp_dev_node_info node_info;
 
 #ifdef CONFIG_HOTPLUG
 
-static int unloading = 0;
 static struct completion unload_sem;
 
 /*
@@ -159,7 +157,7 @@ static int pnp_dock_thread(void *unused)
        int docked = -1, d = 0;
 
        set_freezable();
-       while (!unloading) {
+       while (1) {
                int status;
 
                /*
@@ -204,8 +202,7 @@ static int pnp_dock_thread(void *unused)
 
 #endif                         /* CONFIG_HOTPLUG */
 
-static int pnpbios_get_resources(struct pnp_dev *dev,
-                                struct pnp_resource_table *res)
+static int pnpbios_get_resources(struct pnp_dev *dev)
 {
        u8 nodenum = dev->number;
        struct pnp_bios_node *node;
@@ -213,6 +210,7 @@ static int pnpbios_get_resources(struct pnp_dev *dev,
        if (!pnpbios_is_dynamic(dev))
                return -EPERM;
 
+       pnp_dbg(&dev->dev, "get resources\n");
        node = kzalloc(node_info.max_node_size, GFP_KERNEL);
        if (!node)
                return -1;
@@ -220,14 +218,13 @@ static int pnpbios_get_resources(struct pnp_dev *dev,
                kfree(node);
                return -ENODEV;
        }
-       pnpbios_read_resources_from_node(res, node);
+       pnpbios_read_resources_from_node(dev, node);
        dev->active = pnp_is_active(dev);
        kfree(node);
        return 0;
 }
 
-static int pnpbios_set_resources(struct pnp_dev *dev,
-                                struct pnp_resource_table *res)
+static int pnpbios_set_resources(struct pnp_dev *dev)
 {
        u8 nodenum = dev->number;
        struct pnp_bios_node *node;
@@ -236,6 +233,7 @@ static int pnpbios_set_resources(struct pnp_dev *dev,
        if (!pnpbios_is_dynamic(dev))
                return -EPERM;
 
+       pnp_dbg(&dev->dev, "set resources\n");
        node = kzalloc(node_info.max_node_size, GFP_KERNEL);
        if (!node)
                return -1;
@@ -243,7 +241,7 @@ static int pnpbios_set_resources(struct pnp_dev *dev,
                kfree(node);
                return -ENODEV;
        }
-       if (pnpbios_write_resources_to_node(res, node) < 0) {
+       if (pnpbios_write_resources_to_node(dev, node) < 0) {
                kfree(node);
                return -1;
        }
@@ -347,7 +345,7 @@ static int __init insert_device(struct pnp_bios_node *node)
 
        /* clear out the damaged flags */
        if (!dev->active)
-               pnp_init_resource_table(&dev->res);
+               pnp_init_resources(dev);
 
        pnp_add_device(dev);
        pnpbios_interface_attach_device(node);
@@ -520,7 +518,7 @@ static int __init pnpbios_init(void)
 {
        int ret;
 
-#if defined(CONFIG_PPC_MERGE)
+#if defined(CONFIG_PPC)
        if (check_legacy_ioport(PNPBIOS_BASE))
                return -ENODEV;
 #endif
@@ -572,23 +570,24 @@ static int __init pnpbios_init(void)
        return 0;
 }
 
-subsys_initcall(pnpbios_init);
+fs_initcall(pnpbios_init);
 
 static int __init pnpbios_thread_init(void)
 {
-       struct task_struct *task;
-
-#if defined(CONFIG_PPC_MERGE)
+#if defined(CONFIG_PPC)
        if (check_legacy_ioport(PNPBIOS_BASE))
                return 0;
 #endif
        if (pnpbios_disabled)
                return 0;
 #ifdef CONFIG_HOTPLUG
-       init_completion(&unload_sem);
-       task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
-       if (!IS_ERR(task))
-               unloading = 0;
+       {
+               struct task_struct *task;
+               init_completion(&unload_sem);
+               task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
+               if (IS_ERR(task))
+                       return PTR_ERR(task);
+       }
 #endif
        return 0;
 }