[PATCH 0/3] Fix compilation issue on regulator_common file
Julien Stephan
jstephan at baylibre.com
Wed Dec 10 22:24:21 CET 2025
Hello,
If CONFIG_DM_GPIO is not enabled, compilation of
drivers/power/regulator/regulator_common.c fails with the following
errors:
aarch64-none-linux-gnu-ld: drivers/power/regulator/regulator_common.o: in function `regulator_common_of_to_plat':
<...>/u-boot/drivers/power/regulator/regulator_common.c:30: undefined reference to `gpio_request_by_name'
aarch64-none-linux-gnu-ld: drivers/power/regulator/regulator_common.o: in function `regulator_common_get_enable':
<...>/u-boot/drivers/power/regulator/regulator_common.c:57: undefined reference to `dm_gpio_get_value'
aarch64-none-linux-gnu-ld: drivers/power/regulator/regulator_common.o: in function `regulator_common_set_enable':
<...>/u-boot/drivers/power/regulator/regulator_common.c:92: undefined reference to `dm_gpio_set_value'
make: *** [Makefile:2029: u-boot] Error 139
Since the enable gpio is optional we can conditionally skip these calls.
While at it, use dm_gpio_is_valid() helper function in
regulator_common_get_enable, and remove a debug message that checkpatch
--strict complains about:
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
The 2 fixes are done before the compilation issue fix in order to easily
cherry-pick them if needed
Signed-off-by: Julien Stephan <jstephan at baylibre.com>
---
Julien Stephan (3):
power: regulator: common: remove unnecessary debug trace
power: regulator: common: use dm_gpio_is_valid helper
power: regulator: common: fix compilation issue
drivers/power/regulator/regulator_common.c | 89 +++++++++++++++---------------
1 file changed, 45 insertions(+), 44 deletions(-)
---
base-commit: c5e6d2ab7eba68cbfb600cdc131c0c375ced2ec9
change-id: 20251209-power-regulator-fix-compilation-5232b0365c7b
Best regards,
--
Julien Stephan <jstephan at baylibre.com>
More information about the U-Boot
mailing list