diff mbox series

[1/3] psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled

Message ID 16a96efe0e8194507bfe6b6ef391aeab6f10e786.1626188686.git.michal.simek@xilinx.com
State Accepted
Commit bfc05d7e2af334c5907c38a94eddb18b5e92faaf
Delegated to: Michal Simek
Headers show
Series arm64: zynqmp: Use sysreset framework for reset and poweroff | expand

Commit Message

Michal Simek July 13, 2021, 3:04 p.m. UTC
CONFIG_SYSRESET_CMD_POWEROFF defines do_poweroff() in sysreset-uclass.c
that's why don't define it twice when both CONFIG_SYSRESET_CMD_POWEROFF and
CONFIG_CMD_POWEROFF are enabled. CONFIG_SYSRESET_CMD_POWEROFF depends on
CONFIG_CMD_POWEROFF.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/firmware/psci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index 89cb7d88e5b3..657e7eb5aea3 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -210,7 +210,7 @@  void psci_sys_poweroff(void)
 	invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
-#ifdef CONFIG_CMD_POWEROFF
+#if IS_ENABLED(CONFIG_CMD_POWEROFF) && !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF)
 int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
 	do_psci_probe();