ChangeSet 1.1939.1.68, 2004/09/29 16:06:36-07:00, [EMAIL PROTECTED]

[PATCH] usb/mdc800: cleanup set_current_state() around wait queues

This patch cleans up the wait queue usage in this driver.  The state is
no longer set until just before the task sleeps, which removes a few
set_current_state()s. Correspondingly, the state doesn't need to be set
back to TASK_RUNNING outside of the while-loops, as schedule_timeout()
takes care of it.

Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/image/mdc800.c |    4 ----
 1 files changed, 4 deletions(-)


diff -Nru a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
--- a/drivers/usb/image/mdc800.c        2004-10-19 08:07:35 -07:00
+++ b/drivers/usb/image/mdc800.c        2004-10-19 08:07:35 -07:00
@@ -317,7 +317,6 @@
        mdc800->camera_request_ready=1+mode;
 
        add_wait_queue(&mdc800->irq_wait, &wait);
-       set_current_state(TASK_INTERRUPTIBLE);
        timeout = msec*HZ/1000;
        while (!mdc800->irq_woken && timeout)
        {
@@ -325,7 +324,6 @@
                timeout = schedule_timeout (timeout);
        }
         remove_wait_queue(&mdc800->irq_wait, &wait);
-       set_current_state(TASK_RUNNING);
        mdc800->irq_woken = 0;
 
        if (mdc800->camera_request_ready>0)
@@ -725,7 +723,6 @@
                                        set_current_state(TASK_UNINTERRUPTIBLE);
                                        timeout = schedule_timeout (timeout);
                                }
-                               set_current_state(TASK_RUNNING);
                                remove_wait_queue(&mdc800->download_wait, &wait);
                                mdc800->downloaded = 0;
                                if (mdc800->download_urb->status != 0)
@@ -851,7 +848,6 @@
                                set_current_state(TASK_UNINTERRUPTIBLE);
                                timeout = schedule_timeout (timeout);
                        }
-                        set_current_state(TASK_RUNNING);
                        remove_wait_queue(&mdc800->write_wait, &wait);
                        mdc800->written = 0;
                        if (mdc800->state == WORKING)



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to