[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11769695573440-git-send-email-ebiederm@xmission.com>
Date: Thu, 19 Apr 2007 01:58:35 -0600
From: "Eric W. Biederman" <ebiederm@...ssion.com>
To: "<Andrew Morton" <akpm@...l.org>
Cc: <containers@...ts.osdl.org>, Oleg Nesterov <oleg@...sign.ru>,
Christoph Hellwig <hch@...radead.org>,
<linux-kernel@...r.kernel.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Jyoti Shah <jshah@...ibm.com>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: [PATCH] ibmphp: Convert to use the kthreads API
From: Eric W. Biederman <ebiederm@...ssion.com>
kthread_run replaces kernel_thread and dameonize.
allow_signal is unnecessary and has been removed.
tid_poll was unused and has been removed.
Cc: Jyoti Shah <jshah@...ibm.com>
Cc: Greg Kroah-Hartman <gregkh@...e.de>
Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
---
drivers/pci/hotplug/ibmphp_hpc.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 46abaa8..27e12f1 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -34,6 +34,7 @@
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/mutex.h>
+#include <linux/kthread.h>
#include "ibmphp.h"
@@ -101,7 +102,6 @@ static int to_debug = 0;
// global variables
//----------------------------------------------------------------------------
static int ibmphp_shutdown;
-static int tid_poll;
static struct mutex sem_hpcaccess; // lock access to HPC
static struct semaphore semOperations; // lock all operations and
// access to data structures
@@ -137,7 +137,6 @@ void __init ibmphp_hpc_initvars (void)
init_MUTEX_LOCKED (&sem_exit);
to_debug = 0;
ibmphp_shutdown = 0;
- tid_poll = 0;
debug ("%s - Exit\n", __FUNCTION__);
}
@@ -1060,12 +1059,8 @@ static int hpc_poll_thread (void *data)
{
debug ("%s - Entry\n", __FUNCTION__);
- daemonize("hpc_poll");
- allow_signal(SIGKILL);
-
poll_hpc ();
- tid_poll = 0;
debug ("%s - Exit\n", __FUNCTION__);
return 0;
}
@@ -1078,17 +1073,18 @@ static int hpc_poll_thread (void *data)
*---------------------------------------------------------------------*/
int __init ibmphp_hpc_start_poll_thread (void)
{
+ struct task_struct *task;
int rc = 0;
debug ("%s - Entry\n", __FUNCTION__);
- tid_poll = kernel_thread (hpc_poll_thread, NULL, 0);
- if (tid_poll < 0) {
+ task = kthread_run(hpc_poll_thread, NULL, "hpc_poll");
+ if (IS_ERR(task)) {
err ("%s - Error, thread not started\n", __FUNCTION__);
rc = -1;
}
- debug ("%s - Exit tid_poll[%d] rc[%d]\n", __FUNCTION__, tid_poll, rc);
+ debug ("%s - Exit rc[%d]\n", __FUNCTION__, rc);
return rc;
}
--
1.5.0.g53756
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists