aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-06 03:02:57 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:02:57 -0400
commitf541ae326fa120fa5c57433e4d9a133df212ce41 (patch)
treebdbd94ec72cfc601118051cb35e8617d55510177 /drivers/pnp
parente255357764f92afcafafbd4879b222b8c752065a (diff)
parent0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff)
Merge branch 'linus' into perfcounters/core-v2
Merge reason: we have gathered quite a few conflicts, need to merge upstream Conflicts: arch/powerpc/kernel/Makefile arch/x86/ia32/ia32entry.S arch/x86/include/asm/hardirq.h arch/x86/include/asm/unistd_32.h arch/x86/include/asm/unistd_64.h arch/x86/kernel/cpu/common.c arch/x86/kernel/irq.c arch/x86/kernel/syscall_table_32.S arch/x86/mm/iomap_32.c include/linux/sched.h kernel/Makefile Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/core.c23
-rw-r--r--drivers/pnp/pnpbios/core.c16
2 files changed, 24 insertions, 15 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 2834846a185d..9a3a682c6981 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -83,7 +83,6 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
83 acpi_handle handle = dev->data; 83 acpi_handle handle = dev->data;
84 struct acpi_buffer buffer; 84 struct acpi_buffer buffer;
85 int ret; 85 int ret;
86 acpi_status status;
87 86
88 pnp_dbg(&dev->dev, "set resources\n"); 87 pnp_dbg(&dev->dev, "set resources\n");
89 ret = pnpacpi_build_resource_template(dev, &buffer); 88 ret = pnpacpi_build_resource_template(dev, &buffer);
@@ -94,21 +93,31 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
94 kfree(buffer.pointer); 93 kfree(buffer.pointer);
95 return ret; 94 return ret;
96 } 95 }
97 status = acpi_set_current_resources(handle, &buffer); 96 if (ACPI_FAILURE(acpi_set_current_resources(handle, &buffer)))
98 if (ACPI_FAILURE(status))
99 ret = -EINVAL; 97 ret = -EINVAL;
98 else if (acpi_bus_power_manageable(handle))
99 ret = acpi_bus_set_power(handle, ACPI_STATE_D0);
100 kfree(buffer.pointer); 100 kfree(buffer.pointer);
101 return ret; 101 return ret;
102} 102}
103 103
104static int pnpacpi_disable_resources(struct pnp_dev *dev) 104static int pnpacpi_disable_resources(struct pnp_dev *dev)
105{ 105{
106 acpi_status status; 106 acpi_handle handle = dev->data;
107 int ret;
108
109 dev_dbg(&dev->dev, "disable resources\n");
107 110
108 /* acpi_unregister_gsi(pnp_irq(dev, 0)); */ 111 /* acpi_unregister_gsi(pnp_irq(dev, 0)); */
109 status = acpi_evaluate_object((acpi_handle) dev->data, 112 ret = 0;
110 "_DIS", NULL, NULL); 113 if (acpi_bus_power_manageable(handle)) {
111 return ACPI_FAILURE(status) ? -ENODEV : 0; 114 ret = acpi_bus_set_power(handle, ACPI_STATE_D3);
115 if (ret)
116 return ret;
117 }
118 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL)))
119 ret = -ENODEV;
120 return ret;
112} 121}
113 122
114#ifdef CONFIG_ACPI_SLEEP 123#ifdef CONFIG_ACPI_SLEEP
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 996f64838079..cfe86853feb2 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -94,7 +94,6 @@ struct pnp_dev_node_info node_info;
94 94
95#ifdef CONFIG_HOTPLUG 95#ifdef CONFIG_HOTPLUG
96 96
97static int unloading = 0;
98static struct completion unload_sem; 97static struct completion unload_sem;
99 98
100/* 99/*
@@ -158,7 +157,7 @@ static int pnp_dock_thread(void *unused)
158 int docked = -1, d = 0; 157 int docked = -1, d = 0;
159 158
160 set_freezable(); 159 set_freezable();
161 while (!unloading) { 160 while (1) {
162 int status; 161 int status;
163 162
164 /* 163 /*
@@ -575,8 +574,6 @@ fs_initcall(pnpbios_init);
575 574
576static int __init pnpbios_thread_init(void) 575static int __init pnpbios_thread_init(void)
577{ 576{
578 struct task_struct *task;
579
580#if defined(CONFIG_PPC) 577#if defined(CONFIG_PPC)
581 if (check_legacy_ioport(PNPBIOS_BASE)) 578 if (check_legacy_ioport(PNPBIOS_BASE))
582 return 0; 579 return 0;
@@ -584,10 +581,13 @@ static int __init pnpbios_thread_init(void)
584 if (pnpbios_disabled) 581 if (pnpbios_disabled)
585 return 0; 582 return 0;
586#ifdef CONFIG_HOTPLUG 583#ifdef CONFIG_HOTPLUG
587 init_completion(&unload_sem); 584 {
588 task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd"); 585 struct task_struct *task;
589 if (!IS_ERR(task)) 586 init_completion(&unload_sem);
590 unloading = 0; 587 task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
588 if (IS_ERR(task))
589 return PTR_ERR(task);
590 }
591#endif 591#endif
592 return 0; 592 return 0;
593} 593}