From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993182AbXDSIHE (ORCPT ); Thu, 19 Apr 2007 04:07:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S2993191AbXDSIG0 (ORCPT ); Thu, 19 Apr 2007 04:06:26 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:45846 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993182AbXDSIGC (ORCPT ); Thu, 19 Apr 2007 04:06:02 -0400 From: "Eric W. Biederman" To: " Cc: , Oleg Nesterov , Christoph Hellwig , , "Eric W. Biederman" , Greg Kroah-Hartman Subject: [PATCH] cpqphp: Convert to use the kthread API Date: Thu, 19 Apr 2007 01:58:36 -0600 Message-Id: <11769695592278-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 1.5.1.1.g2de0 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Eric W. Biederman This patch changes cpqphp to use kthread_run and not kernel_thread and daemonize to startup and setup the cpqphp thread. Cc: Greg Kroah-Hartman Signed-off-by: Eric W. Biederman --- drivers/pci/hotplug/cpqphp_ctrl.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 79ff6b4..c2c06c4 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "cpqphp.h" static u32 configure_new_device(struct controller* ctrl, struct pci_func *func, @@ -1746,10 +1747,6 @@ static void pushbutton_helper_thread(unsigned long data) static int event_thread(void* data) { struct controller *ctrl; - lock_kernel(); - daemonize("phpd_event"); - - unlock_kernel(); while (1) { dbg("!!!!event_thread sleeping\n"); @@ -1771,7 +1768,7 @@ static int event_thread(void* data) int cpqhp_event_start_thread(void) { - int pid; + struct task_struct *task; /* initialize our semaphores */ init_MUTEX(&delay_sem); @@ -1779,12 +1776,11 @@ int cpqhp_event_start_thread(void) init_MUTEX_LOCKED(&event_exit); event_finished=0; - pid = kernel_thread(event_thread, NULL, 0); - if (pid < 0) { + task = kthread_run(event_thread, NULL, "phpd_event"); + if (IS_ERR(task)) { err ("Can't start up our event thread\n"); return -1; } - dbg("Our event thread pid = %d\n", pid); return 0; } -- 1.5.0.g53756