[PATCH] usb: chipidea: scope ci_ulpi_resume() to CONFIG_PM
From: Pengpeng Hou
Date: Mon Mar 09 2026 - 04:45:49 EST
In current linux.git (1954c4f01220), ci_ulpi_resume() is defined
and declared unconditionally. However, its only in-tree caller is within
ci_controller_resume() in drivers/usb/chipidea/core.c, which is already
guarded by #ifdef CONFIG_PM.
Match the helper scope to its caller by wrapping the definition in
CONFIG_PM and providing a no-op stub in the header. This fixes the
config-scope mismatch and avoids unnecessary code inclusion when
power management is disabled.
Signed-off-by: Pengpeng Hou <pengpeng.hou@xxxxxxxxxxxxxxxx>
---
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@
int ci_ulpi_init(struct ci_hdrc *ci);
void ci_ulpi_exit(struct ci_hdrc *ci);
+#ifdef CONFIG_PM
int ci_ulpi_resume(struct ci_hdrc *ci);
+#else
+static inline int ci_ulpi_resume(struct ci_hdrc *ci)
+{
+ return 0;
+}
+#endif
u32 hw_read_intr_enable(struct ci_hdrc *ci);
diff --git a/drivers/usb/chipidea/ulpi.c b/drivers/usb/chipidea/ulpi.c
--- a/drivers/usb/chipidea/ulpi.c
+++ b/drivers/usb/chipidea/ulpi.c
@@
void ci_ulpi_exit(struct ci_hdrc *ci)
{
if (ci->ulpi) {
ulpi_unregister_interface(ci->ulpi);
ci->ulpi = NULL;
}
}
+#ifdef CONFIG_PM
int ci_ulpi_resume(struct ci_hdrc *ci)
{
int cnt = 100000;
@@
return -ETIMEDOUT;
}
+#endif