Simplify the state handle, the idle state will only be entered from do_close. Signed-off-by: Jules Maselbas <jmaselbas@xxxxxxxxx> --- drivers/usb/gadget/dfu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c index 3234f25b3..1dc659953 100644 --- a/drivers/usb/gadget/dfu.c +++ b/drivers/usb/gadget/dfu.c @@ -320,6 +320,8 @@ static void dfu_do_close(struct dfu_work *dw) if (!stat(DFU_TEMPFILE, &s)) unlink(DFU_TEMPFILE); + + dw->dfu->dfu_state = DFU_STATE_dfuIDLE; } static void dfu_do_copy(struct dfu_work *dw) @@ -756,11 +758,8 @@ static int dfu_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) case DFU_STATE_dfuMANIFEST_SYNC: switch (ctrl->bRequest) { case USB_REQ_DFU_GETSTATUS: + dfu->dfu_state = DFU_STATE_dfuMANIFEST; value = dfu_status(f, ctrl); - if (dfu_file_entry->flags & FILE_LIST_FLAG_SAFE) - dfu->dfu_state = DFU_STATE_dfuMANIFEST; - else - dfu->dfu_state = DFU_STATE_dfuIDLE; value = min(value, w_length); break; case USB_REQ_DFU_GETSTATE: -- 2.17.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox