[U-Boot] [PATCH v3 09/13] fastboot: Rename fb_set_reboot_flag to fastboot_set_reboot_flag
Alex Kiernan
alex.kiernan at gmail.com
Mon May 14 09:09:04 UTC 2018
Rename fb_set_reboot_flag to fastboot_set_reboot_flag so it matches
all other fastboot code in the global name space. Fix the guards around
them so that they're dependent on FASTBOOT, not just USB_FUNCTION_FASTBOOT.
Move the weak implementation of fastboot_set_reboot_flag to fb_common.c
so we can call it from non-USB fastboot code.
Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---
Changes in v3:
- new
Changes in v2: None
arch/arm/mach-omap2/boot-common.c | 4 ++--
arch/arm/mach-rockchip/rk3128-board.c | 4 ++--
arch/arm/mach-rockchip/rk322x-board.c | 4 ++--
board/amazon/kc1/kc1.c | 2 +-
board/lg/sniper/sniper.c | 2 +-
drivers/fastboot/fb_common.c | 5 +++++
drivers/usb/gadget/f_fastboot.c | 7 +------
include/fastboot.h | 2 +-
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
index 0e9fd03..b22b671 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -237,8 +237,8 @@ void arch_preboot_os(void)
}
#endif
-#if defined(CONFIG_USB_FUNCTION_FASTBOOT) && !defined(CONFIG_ENV_IS_NOWHERE)
-int fb_set_reboot_flag(void)
+#if CONFIG_IS_ENABLED(FASTBOOT) && !CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
+int fastboot_set_reboot_flag(void)
{
printf("Setting reboot to fastboot flag ...\n");
env_set("dofastboot", "1");
diff --git a/arch/arm/mach-rockchip/rk3128-board.c b/arch/arm/mach-rockchip/rk3128-board.c
index 48cd8ba..7fd667a 100644
--- a/arch/arm/mach-rockchip/rk3128-board.c
+++ b/arch/arm/mach-rockchip/rk3128-board.c
@@ -111,8 +111,8 @@ int board_usb_cleanup(int index, enum usb_init_type init)
}
#endif
-#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
-int fb_set_reboot_flag(void)
+#if CONFIG_IS_ENABLED(FASTBOOT)
+int fastboot_set_reboot_flag(void)
{
struct rk3128_grf *grf;
diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c
index 99a60c4..7366d45 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -139,8 +139,8 @@ int board_usb_cleanup(int index, enum usb_init_type init)
}
#endif
-#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
-int fb_set_reboot_flag(void)
+#if CONFIG_IS_ENABLED(FASTBOOT)
+int fastboot_set_reboot_flag(void)
{
struct rk322x_grf *grf;
diff --git a/board/amazon/kc1/kc1.c b/board/amazon/kc1/kc1.c
index d9ca183..031fd11 100644
--- a/board/amazon/kc1/kc1.c
+++ b/board/amazon/kc1/kc1.c
@@ -161,7 +161,7 @@ void get_board_serial(struct tag_serialnr *serialnr)
omap_die_id_get_board_serial(serialnr);
}
-int fb_set_reboot_flag(void)
+int fastboot_set_reboot_flag(void)
{
return omap_reboot_mode_store("b");
}
diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c
index 34a7a11..a7de4c2 100644
--- a/board/lg/sniper/sniper.c
+++ b/board/lg/sniper/sniper.c
@@ -173,7 +173,7 @@ void reset_misc(void)
omap_reboot_mode_store(reboot_mode);
}
-int fb_set_reboot_flag(void)
+int fastboot_set_reboot_flag(void)
{
return omap_reboot_mode_store("b");
}
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index c9638f1..e74f3a0 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -47,3 +47,8 @@ void fastboot_okay(const char *reason, char *response)
else
fastboot_response("OKAY", response, NULL);
}
+
+int __weak fastboot_set_reboot_flag(void)
+{
+ return -ENOSYS;
+}
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 323ac89..697eee5 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -357,16 +357,11 @@ static void compl_do_reset(struct usb_ep *ep, struct usb_request *req)
do_reset(NULL, 0, 0, NULL);
}
-int __weak fb_set_reboot_flag(void)
-{
- return -ENOSYS;
-}
-
static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
{
char *cmd = req->buf;
if (!strcmp_l1("reboot-bootloader", cmd)) {
- if (fb_set_reboot_flag()) {
+ if (fastboot_set_reboot_flag()) {
fastboot_tx_write_str("FAILCannot set reboot flag");
return;
}
diff --git a/include/fastboot.h b/include/fastboot.h
index 434c46b..f2ef51c 100644
--- a/include/fastboot.h
+++ b/include/fastboot.h
@@ -21,5 +21,5 @@ void fastboot_response(const char *tag, char *response,
void fastboot_fail(const char *reason, char *response);
void fastboot_okay(const char *reason, char *response);
-
+int fastboot_set_reboot_flag(void);
#endif /* _FASTBOOT_H_ */
--
2.7.4
More information about the U-Boot
mailing list