]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aacraid/linit.c
[SCSI] lpfc 8.1.2: Misc FC Discovery changes :
[linux-2.6-omap-h63xx.git] / drivers / scsi / aacraid / linit.c
index 2716178905625911a1364dd559b7f3907e1846a9..c2596335549da13ff2f121698d61251a7044ca5b 100644 (file)
@@ -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);