aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/linit.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-02-14 12:45:06 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-27 23:55:14 -0500
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 @@
48#include <linux/syscalls.h> 48#include <linux/syscalls.h>
49#include <linux/delay.h> 49#include <linux/delay.h>
50#include <linux/smp_lock.h> 50#include <linux/smp_lock.h>
51#include <linux/kthread.h>
51#include <asm/semaphore.h> 52#include <asm/semaphore.h>
52 53
53#include <scsi/scsi.h> 54#include <scsi/scsi.h>
@@ -850,10 +851,10 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
850 /* 851 /*
851 * Start any kernel threads needed 852 * Start any kernel threads needed
852 */ 853 */
853 aac->thread_pid = kernel_thread((int (*)(void *))aac_command_thread, 854 aac->thread = kthread_run(aac_command_thread, aac, AAC_DRIVERNAME);
854 aac, 0); 855 if (IS_ERR(aac->thread)) {
855 if (aac->thread_pid < 0) {
856 printk(KERN_ERR "aacraid: Unable to create command thread.\n"); 856 printk(KERN_ERR "aacraid: Unable to create command thread.\n");
857 error = PTR_ERR(aac->thread);
857 goto out_deinit; 858 goto out_deinit;
858 } 859 }
859 860
@@ -934,9 +935,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
934 return 0; 935 return 0;
935 936
936 out_deinit: 937 out_deinit:
937 kill_proc(aac->thread_pid, SIGKILL, 0); 938 kthread_stop(aac->thread);
938 wait_for_completion(&aac->aif_completion);
939
940 aac_send_shutdown(aac); 939 aac_send_shutdown(aac);
941 aac_adapter_disable_int(aac); 940 aac_adapter_disable_int(aac);
942 free_irq(pdev->irq, aac); 941 free_irq(pdev->irq, aac);
@@ -970,8 +969,7 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
970 969
971 scsi_remove_host(shost); 970 scsi_remove_host(shost);
972 971
973 kill_proc(aac->thread_pid, SIGKILL, 0); 972 kthread_stop(aac->thread);
974 wait_for_completion(&aac->aif_completion);
975 973
976 aac_send_shutdown(aac); 974 aac_send_shutdown(aac);
977 aac_adapter_disable_int(aac); 975 aac_adapter_disable_int(aac);