Skip to contentSkip to conversation

fastboot: fix fastboot_set_reboot_flag()

PATCH In review Roman Stratiienko 4 participants 4 messages May 8, 2021 – Jan 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fastboot: fix fastboot_set_reboot_flag()

In case CONFIG_FASTBOOT_FLASH_MMC_DEV == 0, compile-time condition is not met and fastboot_set_reboot_flag() fails.

Fixes a362ce214f03 ("fastboot: Implement generic fastboot_set_reboot_flag")
---
 drivers/fastboot/fb_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fastboot/fb_common.c +1 -1
index cbcc3683c47..ef399d0c4ab 100644
@@ -91,7 +91,7 @@ void fastboot_okay(const char *reason, char *response)
  */
 int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
 {
-#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC_DEV)
+#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
 	static const char * const boot_cmds[] = {
 		[FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader",
 		[FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Roman Stratiienko

In case CONFIG_FASTBOOT_FLASH_MMC_DEV == 0, compile-time condition is not met and fastboot_set_reboot_flag() fails.

Fixes a362ce214f03 ("fastboot: Implement generic fastboot_set_reboot_flag")
---
  drivers/fastboot/fb_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fastboot/fb_common.c +0 -0
index cbcc3683c47..ef399d0c4ab 100644

drivers/fastboot/fb_common.c void fastboot_okay(const char *reason, char *response) · line 97

Quoted 8 lines
drivers/fastboot/fb_common.c +1 -1
@@ -91,7 +91,7 @@ void fastboot_okay(const char *reason, char *response)
   */
  int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
  {
-#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC_DEV)
+#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
  	static const char * const boot_cmds[] = {
  		[FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader",
  		[FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",
#2 lore raw

Hi Roman,

Thank you for your patch.

Quoted 10 lines · Sean Anderson
Quoted 9 lines · Roman Stratiienko

In case CONFIG_FASTBOOT_FLASH_MMC_DEV == 0, compile-time condition is not met and fastboot_set_reboot_flag() fails.

Fixes a362ce214f03 ("fastboot: Implement generic fastboot_set_reboot_flag")
---
  drivers/fastboot/fb_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
drivers/fastboot/fb_common.c +0 -0
index cbcc3683c47..ef399d0c4ab 100644

drivers/fastboot/fb_common.c void fastboot_okay(const char *reason, char *response) · line 97

Quoted 8 lines
drivers/fastboot/fb_common.c +1 -1
@@ -91,7 +91,7 @@ void fastboot_okay(const char *reason, char *response)
   */
  int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
  {
-#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC_DEV)
+#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
  	static const char * const boot_cmds[] = {
  		[FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader",
  		[FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",

I'm using this in the (out of tree) U-Boot for khadas VIM3L/VIM3 boards:
https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integ

#3 lore raw
In reply to Roman Stratiienko
Quoted 7 lines · Roman Stratiienko

In case CONFIG_FASTBOOT_FLASH_MMC_DEV == 0, compile-time condition is not met and fastboot_set_reboot_flag() fails.

Fixes a362ce214f03 ("fastboot: Implement generic fastboot_set_reboot_flag")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom