Skip to contentSkip to conversation

staging/rts_pstor: use kthread_run instead doing kthread_create and wake_up_process

PATCH New Devendra Naga 1 participant 1 message Jul 15, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/rts_pstor: use kthread_run instead doing kthread_create and wake_up_process

with kthread_create we need to call wake_up_process to run the thread, this can be done using the macro kthread_run, which creates and if thread creation is succeeded starts the thread by calling wake_up_process,

and also there are two more threads in the rts_pstor, which calls kthread_run instead calling kthread_create and another call to the wake_up_process, so with this change the creation of rtsx_scan_thread will be in consistency with the other control and poll threads.

---
Compile tested only,.. didn't done ps ax to check whether this thread runs correctly. the thread functions are calling complete_and_exit, and not returning any value as the other drivers do.

 drivers/staging/rts_pstor/rtsx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/rts_pstor/rtsx.c +1 -3
index 1dccd93..5fb05a2 100644
@@ -1021,7 +1021,7 @@ static int __devinit rtsx_probe(struct pci_dev *pci,
 	}
 
 	/* Start up the thread for delayed SCSI-device scanning */
-	th = kthread_create(rtsx_scan_thread, dev, "rtsx-scan");
+	th = kthread_run(rtsx_scan_thread, dev, "rtsx-scan");
 	if (IS_ERR(th)) {
 		printk(KERN_ERR "Unable to start the device-scanning thread\n");
 		complete(&dev->scanning_done);
@@ -1030,8 +1030,6 @@ static int __devinit rtsx_probe(struct pci_dev *pci,
 		goto errout;
 	}
 
-	wake_up_process(th);
-
 	/* Start up the thread for polling thread */
 	th = kthread_run(rtsx_polling_thread, dev, "rtsx-polling");
 	if (IS_ERR(th)) {
Signature · 1 line
1.7.0.4