lkml.org 
[lkml]   [2007]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] ibmphp: Convert to use the kthreads API
    Date
    From: Eric W. Biederman <ebiederm@xmission.com> - unquoted

    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@us.ibm.com>
    Cc: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.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@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-04-19 09:03    [W:4.669 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site