[PATCH 3/9] staging: brcm80211: remove kernel_thread() for dhd_watchdog_thread.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jason Cooper <jason@xxxxxxxxxxxxxx>
---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 1441b33..125ee43 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -23,6 +23,7 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/kthread.h>
 #include <linux/slab.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
@@ -1912,6 +1913,7 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
 {
 	dhd_info_t *dhd = NULL;
 	struct net_device *net;
+	struct task_struct *tsk;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 	/* updates firmware nvram path if it was provided as module
@@ -2020,7 +2022,14 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
 		/* Initialize watchdog thread */
 		sema_init(&dhd->watchdog_sem, 0);
 		init_completion(&dhd->watchdog_exited);
-		dhd->watchdog_pid = kernel_thread(dhd_watchdog_thread, dhd, 0);
+		tsk = kthread_run(dhd_watchdog_thread, dhd, "dhd_watchdog");
+		if (IS_ERR(tsk)) {
+			printk(KERN_WARNING
+				"dhd_watchdog thread failed to start\n");
+			dhd->watchdog_pid = -1;
+		} else {
+			dhd->watchdog_pid = (long)get_pid(task_pid(tsk));
+		}
 	} else {
 		dhd->watchdog_pid = -1;
 	}
-- 
1.6.3.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux