Skip to contentSkip to conversation

regulator: qcom_saw: Fix testing wrong value

PATCH In review Axel Lin 2 participants 3 messages Feb 11, 2016 – Feb 20, 2016

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 regulator: qcom_saw: Fix testing wrong value

---
 drivers/regulator/qcom_saw-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/qcom_saw-regulator.c +2 -2
index c800f16..c00f0df 100644
@@ -186,8 +186,8 @@ static int qcom_saw_regulator_probe(struct platform_device *pdev)
 
 	vreg->regmap = syscon_node_to_regmap(saw_np);
 	of_node_put(saw_np);
-	if (IS_ERR(config.regmap))
-		return PTR_ERR(config.regmap);
+	if (IS_ERR(vreg->regmap))
+		return PTR_ERR(vreg->regmap);
 
 	snprintf(name, sizeof(name), "krait%d", cpu);
 
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH 2/2 regulator: qcom_saw: Fix uninitialized variable build warning

Fix below build warning:
CC [M] drivers/regulator/qcom_saw-regulator.o
drivers/regulator/qcom_saw-regulator.c: In function 'qcom_saw_regulator_probe':
drivers/regulator/qcom_saw-regulator.c:154:5: warning: 'found' is used uninitialized in this function [-Wuninitialized] drivers/regulator/qcom_saw-regulator.c:140:7: note: 'found' was declared here

---
 drivers/regulator/qcom_saw-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/qcom_saw-regulator.c +1 -1
index c00f0df..6751614 100644
@@ -137,7 +137,7 @@ static struct saw_vreg *saw_get_drv(struct platform_device *pdev,
 	struct saw_vreg *vreg = NULL;
 	struct device_node *cpu_node, *saw_node;
 	int cpu;
-	bool found;
+	bool found = false;
 
 	for_each_possible_cpu(cpu) {
 		cpu_node = of_cpu_device_node_get(cpu);
Signature · 1 line
2.1.4