Skip to contentSkip to conversation

power: reset: nvmem-reboot-mode: add CONFIG_OF dependency

PATCH In review Arnd Bergmann 2 participants 3 messages Jul 8, 2019 – Aug 5, 2019 System reset/shutdown drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: reset: nvmem-reboot-mode: add CONFIG_OF dependency

Without CONFIG_OF, we get a build failure in the reboot-mode implementation:

drivers/power/reset/reboot-mode.c: In function 'reboot_mode_register':
drivers/power/reset/reboot-mode.c:72:2: error: implicit declaration of function 'for_each_property_of_node'; did you mean 'for_each_child_of_node'? [-Werror=implicit-function-declaration]
for_each_property_of_node(np, prop) {

Add a Kconfig dependency like we have for the other users of CONFIG_REBOOT_MODE.

Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")
---
 drivers/power/reset/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/power/reset/Kconfig +1 -0
index 8dfb105db391..a564237278ff 100644
@@ -248,6 +248,7 @@ config POWER_RESET_SC27XX
 
 config NVMEM_REBOOT_MODE
 	tristate "Generic NVMEM reboot mode driver"
+	depends on OF
 	select REBOOT_MODE
 	help
 	  Say y here will enable reboot mode driver. This will
Signature · 1 line
2.20.0
#1 lore raw
Quoted 22 lines · Arnd Bergmann

Without CONFIG_OF, we get a build failure in the reboot-mode implementation:

drivers/power/reset/reboot-mode.c: In function 'reboot_mode_register':
drivers/power/reset/reboot-mode.c:72:2: error: implicit declaration of function 'for_each_property_of_node'; did you mean 'for_each_child_of_node'? [-Werror=implicit-function-declaration]
for_each_property_of_node(np, prop) {

Add a Kconfig dependency like we have for the other users of CONFIG_REBOOT_MODE.

Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")
---
  drivers/power/reset/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/power/reset/Kconfig +0 -0
index 8dfb105db391..a564237278ff 100644

drivers/power/reset/Kconfig config POWER_RESET_SC27XX · line 254

Quoted 7 lines
drivers/power/reset/Kconfig +1 -0
@@ -248,6 +248,7 @@ config POWER_RESET_SC27XX
 
  config NVMEM_REBOOT_MODE
  	tristate "Generic NVMEM reboot mode driver"
+	depends on OF
  	select REBOOT_MODE
  	help
  	  Say y here will enable reboot mode driver. This will

Wouldn't this be more appropriate to add the "depends on OF" to "config REBOOT_MODE" section, since this is an error to reboot-mode.c unit?

Nandor

#2 lore raw
Quoted 24 lines · Nandor Han
Quoted 22 lines · Arnd Bergmann

Without CONFIG_OF, we get a build failure in the reboot-mode implementation:

drivers/power/reset/reboot-mode.c: In function 'reboot_mode_register':
drivers/power/reset/reboot-mode.c:72:2: error: implicit declaration of function 'for_each_property_of_node'; did you mean 'for_each_child_of_node'? [-Werror=implicit-function-declaration]
for_each_property_of_node(np, prop) {

Add a Kconfig dependency like we have for the other users of CONFIG_REBOOT_MODE.

Fixes 7a78a7f7695b ("power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface")
---
  drivers/power/reset/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/power/reset/Kconfig +0 -0
index 8dfb105db391..a564237278ff 100644
@@ -248,6 +248,7 @@ config POWER_RESET_SC27XX
 
Quoted 10 lines

drivers/power/reset/Kconfig config POWER_RESET_SC27XX · line 254

Quoted 7 lines
drivers/power/reset/Kconfig +1 -0
  config NVMEM_REBOOT_MODE
      tristate "Generic NVMEM reboot mode driver"
+     depends on OF
      select REBOOT_MODE
      help
        Say y here will enable reboot mode driver. This will

Wouldn't this be more appropriate to add the "depends on OF" to "config REBOOT_MODE" section, since this is an error to reboot-mode.c unit?

It's too late for 5.3-stable now, as that would break existing configurations that won't select REBOOT_MODE themselves, and it adds a bit of complexity, but we could to it for 5.4 if you think that is necessary.

Arnd