Skip to content

Commit 83bff10

Browse files
caihuoqing1990herbertx
authored andcommitted
crypto: ccp - 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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 284340a commit 83bff10

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

drivers/crypto/ccp/ccp-dev-v3.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ static int ccp_init(struct ccp_device *ccp)
467467

468468
cmd_q = &ccp->cmd_q[i];
469469

470-
kthread = kthread_create(ccp_cmd_queue_thread, cmd_q,
471-
"%s-q%u", ccp->name, cmd_q->id);
470+
kthread = kthread_run(ccp_cmd_queue_thread, cmd_q,
471+
"%s-q%u", ccp->name, cmd_q->id);
472472
if (IS_ERR(kthread)) {
473473
dev_err(dev, "error creating queue thread (%ld)\n",
474474
PTR_ERR(kthread));
@@ -477,7 +477,6 @@ static int ccp_init(struct ccp_device *ccp)
477477
}
478478

479479
cmd_q->kthread = kthread;
480-
wake_up_process(kthread);
481480
}
482481

483482
dev_dbg(dev, "Enabling interrupts...\n");

drivers/crypto/ccp/ccp-dev-v5.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@ static int ccp5_init(struct ccp_device *ccp)
950950

951951
cmd_q = &ccp->cmd_q[i];
952952

953-
kthread = kthread_create(ccp_cmd_queue_thread, cmd_q,
954-
"%s-q%u", ccp->name, cmd_q->id);
953+
kthread = kthread_run(ccp_cmd_queue_thread, cmd_q,
954+
"%s-q%u", ccp->name, cmd_q->id);
955955
if (IS_ERR(kthread)) {
956956
dev_err(dev, "error creating queue thread (%ld)\n",
957957
PTR_ERR(kthread));
@@ -960,7 +960,6 @@ static int ccp5_init(struct ccp_device *ccp)
960960
}
961961

962962
cmd_q->kthread = kthread;
963-
wake_up_process(kthread);
964963
}
965964

966965
dev_dbg(dev, "Enabling interrupts...\n");

0 commit comments

Comments
 (0)