aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pnp/pnpbios/core.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 95738dbd5d45..b71aff21b3fc 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -62,6 +62,7 @@
62#include <linux/delay.h> 62#include <linux/delay.h>
63#include <linux/acpi.h> 63#include <linux/acpi.h>
64#include <linux/freezer.h> 64#include <linux/freezer.h>
65#include <linux/kthread.h>
65 66
66#include <asm/page.h> 67#include <asm/page.h>
67#include <asm/desc.h> 68#include <asm/desc.h>
@@ -159,9 +160,7 @@ static int pnp_dock_thread(void * unused)
159{ 160{
160 static struct pnp_docking_station_info now; 161 static struct pnp_docking_station_info now;
161 int docked = -1, d = 0; 162 int docked = -1, d = 0;
162 daemonize("kpnpbiosd"); 163 while (!unloading)
163 allow_signal(SIGKILL);
164 while(!unloading && !signal_pending(current))
165 { 164 {
166 int status; 165 int status;
167 166
@@ -170,11 +169,8 @@ static int pnp_dock_thread(void * unused)
170 */ 169 */
171 msleep_interruptible(2000); 170 msleep_interruptible(2000);
172 171
173 if(signal_pending(current)) { 172 if (try_to_freeze())
174 if (try_to_freeze()) 173 continue;
175 continue;
176 break;
177 }
178 174
179 status = pnp_bios_dock_station_info(&now); 175 status = pnp_bios_dock_station_info(&now);
180 176
@@ -581,6 +577,7 @@ subsys_initcall(pnpbios_init);
581 577
582static int __init pnpbios_thread_init(void) 578static int __init pnpbios_thread_init(void)
583{ 579{
580 struct task_struct *task;
584#if defined(CONFIG_PPC_MERGE) 581#if defined(CONFIG_PPC_MERGE)
585 if (check_legacy_ioport(PNPBIOS_BASE)) 582 if (check_legacy_ioport(PNPBIOS_BASE))
586 return 0; 583 return 0;
@@ -589,7 +586,8 @@ static int __init pnpbios_thread_init(void)
589 return 0; 586 return 0;
590#ifdef CONFIG_HOTPLUG 587#ifdef CONFIG_HOTPLUG
591 init_completion(&unload_sem); 588 init_completion(&unload_sem);
592 if (kernel_thread(pnp_dock_thread, NULL, CLONE_KERNEL) > 0) 589 task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
590 if (!IS_ERR(task))
593 unloading = 0; 591 unloading = 0;
594#endif 592#endif
595 return 0; 593 return 0;