summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-28 09:07:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-28 14:44:31 +0200
commitc32343519de1774c09995118d0bae56999902a37 (patch)
tree2c923abf526e3f743b75da34e9dd2bd3493fb581 /drivers/usb
parent57313f83e83e1fac87c1a9088175f12ebd3577a0 (diff)
downloadbarebox-c32343519de1774c09995118d0bae56999902a37.tar.gz
barebox-c32343519de1774c09995118d0bae56999902a37.tar.xz
bthread: remove thread exit codes
Follow-up commit will replace blocking bthread_stop with non-blocking bthread_cancel. Prepare for this by dropping exit codes. This is not much of a loss, because most users of bthreads will only call bthread_stop at cleanup time. bthread command is an exception, so have it take manual care of passing around exit codes. As we touch the bthread_stop prototype anyway, rename it to __bthread_stop. This will make it clearer in the future, that it's not meant for driver use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070732.16812-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 4894f91fa6..0033a95f68 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2335,7 +2335,7 @@ static void handle_exception(struct fsg_common *common)
/*-------------------------------------------------------------------------*/
-static int fsg_main_thread(void *common_)
+static void fsg_main_thread(void *common_)
{
struct fsg_common *common = common_;
int ret = 0;
@@ -2374,12 +2374,8 @@ static int fsg_main_thread(void *common_)
common->state = FSG_STATE_IDLE;
}
- if (ret && ret != -ERESTARTSYS) {
+ if (ret && ret != -ERESTARTSYS)
pr_warn("%s: error %pe\n", __func__, ERR_PTR(ret));
- return ret;
- }
-
- return 0;
}
static void fsg_common_release(struct fsg_common *common);
@@ -2541,7 +2537,7 @@ static void fsg_common_release(struct fsg_common *common)
/* If the thread isn't already dead, tell it to exit now */
if (common->state != FSG_STATE_TERMINATED) {
raise_exception(common, FSG_STATE_EXIT);
- bthread_stop(thread_task);
+ __bthread_stop(thread_task);
bthread_free(thread_task);
}
@@ -2568,7 +2564,7 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
fsg->common->new_fsg = NULL;
raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
- bthread_stop(thread_task);
+ __bthread_stop(thread_task);
while (common->fsg == fsg)
bthread_reschedule();
}