summaryrefslogtreecommitdiff
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>2020-08-21 11:14:03 +0800
committerMark Brown <broonie@kernel.org>2020-08-21 17:28:11 +0100
commit0f037255008386f4ac15a201678e8e4565cd91a3 (patch)
tree0cd650ec3c0aa8856f561d323a6432a80079dbb6 /drivers/regulator/fixed.c
parent5e97d7e809a1fd8a2401429df13e0410b77d2142 (diff)
regulator: fixed: Fix W=1 build warnings when CONFIG_OF=n
Fix below warnings when CONFIG_OF=n: drivers/regulator/fixed.c:48:36: warning: ‘fixed_clkenable_data’ defined but not used [-Wunused-const-variable=] 48 | static const struct fixed_dev_type fixed_clkenable_data = { | ^~~~~~~~~~~~~~~~~~~~ drivers/regulator/fixed.c:44:36: warning: ‘fixed_voltage_data’ defined but not used [-Wunused-const-variable=] 44 | static const struct fixed_dev_type fixed_voltage_data = { | ^~~~~~~~~~~~~~~~~~ Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Link: https://lore.kernel.org/r/20200821111403.3e8b58a3@xhacker.debian Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r--drivers/regulator/fixed.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 142a70a89153..5a03fd86ad0a 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -41,14 +41,6 @@ struct fixed_dev_type {
bool has_enable_clock;
};
-static const struct fixed_dev_type fixed_voltage_data = {
- .has_enable_clock = false,
-};
-
-static const struct fixed_dev_type fixed_clkenable_data = {
- .has_enable_clock = true,
-};
-
static int reg_clock_enable(struct regulator_dev *rdev)
{
struct fixed_voltage_data *priv = rdev_get_drvdata(rdev);
@@ -260,6 +252,14 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
}
#if defined(CONFIG_OF)
+static const struct fixed_dev_type fixed_voltage_data = {
+ .has_enable_clock = false,
+};
+
+static const struct fixed_dev_type fixed_clkenable_data = {
+ .has_enable_clock = true,
+};
+
static const struct of_device_id fixed_of_match[] = {
{
.compatible = "regulator-fixed",