summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 279dc465d2..874572741f 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -5494,8 +5494,9 @@ static enum ec_status hc_remote_flash(struct host_cmd_handler_args *args)
if (p->size + sizeof(*p) > args->params_size)
return EC_RES_INVALID_PARAM;
-#if defined(CONFIG_BATTERY_PRESENT_CUSTOM) || \
- defined(CONFIG_BATTERY_PRESENT_GPIO)
+#if defined(CONFIG_BATTERY) && \
+ (defined(CONFIG_BATTERY_PRESENT_CUSTOM) || \
+ defined(CONFIG_BATTERY_PRESENT_GPIO))
/*
* Do not allow PD firmware update if no battery and this port
* is sinking power, because we will lose power.