[PATCH] apm-emulation: Make use of the helper macro kthread_run()

From: 胡连勤
Date: Thu Oct 10 2024 - 05:30:31 EST


From: Lianqin Hu <hulianqin@xxxxxxxx>

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

Signed-off-by: Lianqin Hu <hulianqin@xxxxxxxx>
---
drivers/char/apm-emulation.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index e795390b070f..3c183370a5d6 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -636,13 +636,12 @@ static int __init apm_init(void)
return -ENODEV;
}

- kapmd_tsk = kthread_create(kapmd, NULL, "kapmd");
+ kapmd_tsk = kthread_run(kapmd, NULL, "kapmd");
if (IS_ERR(kapmd_tsk)) {
ret = PTR_ERR(kapmd_tsk);
kapmd_tsk = NULL;
goto out;
}
- wake_up_process(kapmd_tsk);

#ifdef CONFIG_PROC_FS
proc_create_single("apm", 0, NULL, proc_apm_show);
--
2.39.0