[PATCH v2 2/3] usb: f_mass_storage: Drop wakeup_needed
Sean Anderson
sean.anderson at seco.com
Thu Jul 22 20:38:09 CEST 2021
Now that we check bh->state in sleep_thread, there is no need to have a
separate wakeup_needed flag. Drop it.
Signed-off-by: Sean Anderson <sean.anderson at seco.com>
---
(no changes since v1)
drivers/usb/gadget/f_mass_storage.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 6f39c24503..92e4f22797 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -328,7 +328,6 @@ struct fsg_common {
unsigned int bad_lun_okay:1;
unsigned int running:1;
- int thread_wakeup_needed;
struct completion thread_notifier;
struct task_struct *thread_task;
@@ -455,12 +454,6 @@ static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep)
/* These routines may be called in process context or in_irq */
-/* Caller must hold fsg->lock */
-static void wakeup_thread(struct fsg_common *common)
-{
- common->thread_wakeup_needed = 1;
-}
-
static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
{
/* Do nothing if a higher-priority exception is already in progress.
@@ -469,7 +462,6 @@ static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
if (common->state <= new_state) {
common->exception_req_tag = common->ep0_req_tag;
common->state = new_state;
- common->thread_wakeup_needed = 1;
}
}
@@ -508,7 +500,6 @@ static void bulk_in_complete(struct usb_ep *ep, struct usb_request *req)
/* Hold the lock while we update the request and buffer states */
bh->inreq_busy = 0;
bh->state = BUF_STATE_EMPTY;
- wakeup_thread(common);
}
static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req)
@@ -527,7 +518,6 @@ static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req)
/* Hold the lock while we update the request and buffer states */
bh->outreq_busy = 0;
bh->state = BUF_STATE_FULL;
- wakeup_thread(common);
}
/*-------------------------------------------------------------------------*/
@@ -2270,7 +2260,6 @@ static void handle_exception(struct fsg_common *common)
struct fsg_lun *curlun;
unsigned int exception_req_tag;
- common->thread_wakeup_needed = 0;
/* Cancel all the pending transfers */
if (common->fsg) {
for (i = 0; i < FSG_NUM_BUFFERS; ++i) {
--
2.25.1
More information about the U-Boot
mailing list