From d2df2abbcd4b88539605f8329edd244e6474d7a0 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Tue, 29 May 2018 15:30:41 +0000 Subject: fastboot: Extract fastboot_okay/fail to fb_common.c Add drivers/fastboot/fb_common.c, where fastboot_okay/fail are implemented so we can call them from a non-USB implementation. Introduce fastboot_response which takes varargs parameters so we can use it to generate formatted response strings. Refactor fastboot_okay/fail to use it. Signed-off-by: Alex Kiernan Reviewed-by: Joe Hershberger --- drivers/usb/gadget/f_fastboot.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'drivers/usb') diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index bb60612647..2e6e1615bf 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -149,19 +149,6 @@ static struct usb_gadget_strings *fastboot_strings[] = { static void rx_handler_command(struct usb_ep *ep, struct usb_request *req); static int strcmp_l1(const char *s1, const char *s2); - -void fastboot_fail(const char *reason, char *response) -{ - strncpy(response, "FAIL\0", 5); - strncat(response, reason, FASTBOOT_RESPONSE_LEN - 4 - 1); -} - -void fastboot_okay(const char *reason, char *response) -{ - strncpy(response, "OKAY\0", 5); - strncat(response, reason, FASTBOOT_RESPONSE_LEN - 4 - 1); -} - static void fastboot_complete(struct usb_ep *ep, struct usb_request *req) { int status = req->status; -- cgit