Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mt76: Make use of the helper macro kthread_run()

Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>

authored by

Cai Huoqing and committed by
Felix Fietkau
f31a577a 2c4766fd

+4 -6
+4 -6
drivers/net/wireless/mediatek/mt76/util.h
··· 70 70 71 71 if (fn) 72 72 w->fn = fn; 73 - w->task = kthread_create(__mt76_worker_fn, w, "mt76-%s %s", 74 - name, dev_name); 73 + w->task = kthread_run(__mt76_worker_fn, w, 74 + "mt76-%s %s", name, dev_name); 75 75 76 - ret = PTR_ERR_OR_ZERO(w->task); 77 - if (ret) { 76 + if (IS_ERR(w->task)) { 77 + ret = PTR_ERR(w->task); 78 78 w->task = NULL; 79 79 return ret; 80 80 } 81 - 82 - wake_up_process(w->task); 83 81 84 82 return 0; 85 83 }