From: Eric W. Biederman This starts the sparc64 powerd using kthread_run instead of kernel_thread and daemonize. Making the code slightly simpler and more maintainable. In addition the unnecessary flush_signals is removed. Cc: David S. Miller Signed-off-by: Eric W. Biederman Signed-off-by: Andrew Morton --- arch/sparc64/kernel/power.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -puN arch/sparc64/kernel/power.c~sparc64-powerc-convert-to-use-the-kthread-api arch/sparc64/kernel/power.c --- a/arch/sparc64/kernel/power.c~sparc64-powerc-convert-to-use-the-kthread-api +++ a/arch/sparc64/kernel/power.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -81,15 +82,12 @@ static int powerd(void *__unused) char *argv[] = { "/sbin/shutdown", "-h", "now", NULL }; DECLARE_WAITQUEUE(wait, current); - daemonize("powerd"); - add_wait_queue(&powerd_wait, &wait); again: for (;;) { set_task_state(current, TASK_INTERRUPTIBLE); if (button_pressed) break; - flush_signals(current); schedule(); } __set_current_state(TASK_RUNNING); @@ -128,7 +126,9 @@ static int __devinit power_probe(struct poweroff_method = machine_halt; /* able to use the standard halt */ if (has_button_interrupt(irq, op->node)) { - if (kernel_thread(powerd, NULL, CLONE_FS) < 0) { + struct task_struct *task; + task = kthread_run(powerd, NULL, "powerd"); + if (IS_ERR(task)) { printk("Failed to start power daemon.\n"); return 0; } _