Skip to contentSkip to conversation

regulators: Add missing dummy definition for regulator_list_voltage

PATCH New Suzuki K. Poulose 1 participant 1 message Jul 10, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 regulators: Add missing dummy definition for regulator_list_voltage

From: "Suzuki K. Poulose" <[email protected]>

Fixes a build break when CONFIG_REGULATOR is not selected.

e.g, on linux-next - 07102015:

drivers/clk/tegra/clk-dfll.c: In function ‘find_lut_index_for_rate’:
drivers/clk/tegra/clk-dfll.c:691:3: error: implicit declaration of function ‘regulator_list_voltage’ [-Werror=implicit-function-declaration]

    if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv)
    ^

CC drivers/clocksource/mmio.o
CC fs/proc/softirqs.o
cc1: some warnings being treated as errors make[3]: *** [drivers/clk/tegra/clk-dfll.o] Error 1 make[2]: *** [drivers/clk/tegra] Error 2 make[1]: *** [drivers/clk] Error 2
make[1]: *** Waiting for unfinished jobs....

This should be pushed to 4.2 as we have the issue in 4.2-rc1, just that nobody uses it without the REGULATOR(yet).

---
Changes since V1:
- Return -EINVAL instead of 0

---
 include/linux/regulator/consumer.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/linux/regulator/consumer.h +6 -0
index f8a689e..2ba4a40 100644
@@ -550,6 +550,12 @@ static inline int regulator_count_voltages(struct regulator *regulator)
 {
 	return 0;
 }
+
+static inline int regulator_list_voltage(struct regulator *regulator, unsigned selector)
+{
+	return -EINVAL;
+}
+
 #endif
 
 static inline int regulator_set_voltage_tol(struct regulator *regulator,
Signature · 1 line
1.7.9.5