diff options
author | Peter Teoh <htmldeveloper@gmail.com> | 2009-03-21 02:20:23 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 14:53:31 -0700 |
commit | d44ca7af9e79abf4e80514583734cffed1117ee1 (patch) | |
tree | 8d4bf6b25c63f892074f086f0aacf5034fdfe831 /drivers/staging/rt2870/rt_linux.h | |
parent | a955dc39c0dd14e7f85c3d288478294fa133ea90 (diff) | |
download | op-kernel-dev-d44ca7af9e79abf4e80514583734cffed1117ee1.zip op-kernel-dev-d44ca7af9e79abf4e80514583734cffed1117ee1.tar.gz |
Staging: rt2870: Removal of kernel_thread() API
Replacing the use of kernel_thread() with kthread_run(). But as
kthread_run() returned a task structure, as compared with
kernel_thread() returning a PID, it was found to be more efficient to
store the task structure pointer as a field data instead of PID
pointer. On top of modifying the field to store task structure
pointer, the initialization of the field (assigned to
THREAD_PID_INIT_VALUE) was also found unnecessary - as no where it is
found to be used.
Signed-off-by: Peter Teoh <htmldeveloper@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2870/rt_linux.h')
-rw-r--r-- | drivers/staging/rt2870/rt_linux.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/staging/rt2870/rt_linux.h b/drivers/staging/rt2870/rt_linux.h index 49ad37f..5a6ee6a 100644 --- a/drivers/staging/rt2870/rt_linux.h +++ b/drivers/staging/rt2870/rt_linux.h @@ -44,6 +44,7 @@ #include <linux/module.h> #include <linux/version.h> #include <linux/kernel.h> +#include <linux/kthread.h> #include <linux/spinlock.h> #include <linux/init.h> @@ -165,14 +166,12 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) typedef struct pid * THREAD_PID; -#define THREAD_PID_INIT_VALUE NULL #define GET_PID(_v) find_get_pid(_v) #define GET_PID_NUMBER(_v) pid_nr(_v) #define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0) #define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C) #else typedef pid_t THREAD_PID; -#define THREAD_PID_INIT_VALUE -1 #define GET_PID(_v) _v #define GET_PID_NUMBER(_v) _v #define CHECK_PID_LEGALITY(_pid) if (_pid >= 0) @@ -188,11 +187,11 @@ struct os_lock { struct os_cookie { #ifdef RT2870 - struct usb_device *pUsb_Dev; + struct usb_device *pUsb_Dev; - THREAD_PID MLMEThr_pid; - THREAD_PID RTUSBCmdThr_pid; - THREAD_PID TimerQThr_pid; + struct task_struct *MLMEThr_task; + struct task_struct *RTUSBCmdThr_task; + struct task_struct *TimerQThr_task; #endif // RT2870 // struct tasklet_struct rx_done_task; |