summaryrefslogtreecommitdiff
path: root/drivers/scsi/aacraid/linit.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-02-14 18:45:06 +0100
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-27 22:55:14 -0600
commitfe27381d16c6683c55e618360d0d11bd43647e43 (patch)
tree142cd1c8661480081b293fe50de9354b0b181ffd /drivers/scsi/aacraid/linit.c
parent38e14f895b212943995379dea824cc52b0c25991 (diff)
[SCSI] aacraid: use kthread_ API
Use the kthread_ API instead of opencoding lots of hairy code for kernel thread creation and teardown. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Salyzyn, Mark <mark_salyzyn@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r--drivers/scsi/aacraid/linit.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 271617890562..c2596335549d 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -48,6 +48,7 @@
#include <linux/syscalls.h>
#include <linux/delay.h>
#include <linux/smp_lock.h>
+#include <linux/kthread.h>
#include <asm/semaphore.h>
#include <scsi/scsi.h>
@@ -850,10 +851,10 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
/*
* Start any kernel threads needed
*/
- aac->thread_pid = kernel_thread((int (*)(void *))aac_command_thread,
- aac, 0);
- if (aac->thread_pid < 0) {
+ aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME);
+ if (IS_ERR(aac->thread)) {
printk(KERN_ERR "aacraid: Unable to create command thread.\n");
+ error = PTR_ERR(aac->thread);
goto out_deinit;
}
@@ -934,9 +935,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
return 0;
out_deinit:
- kill_proc(aac->thread_pid, SIGKILL, 0);
- wait_for_completion(&aac->aif_completion);
-
+ kthread_stop(aac->thread);
aac_send_shutdown(aac);
aac_adapter_disable_int(aac);
free_irq(pdev->irq, aac);
@@ -970,8 +969,7 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
scsi_remove_host(shost);
- kill_proc(aac->thread_pid, SIGKILL, 0);
- wait_for_completion(&aac->aif_completion);
+ kthread_stop(aac->thread);
aac_send_shutdown(aac);
aac_adapter_disable_int(aac);