Skip to contentSkip to conversation

regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()

PATCH Applied Axel Lin 3 participants 4 messages Aug 18, 2012 – Aug 21, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()

Add missing platform_get_drvdata() call in max8907_regulator_remove(), this fixes below build warning:

CC [M] drivers/regulator/max8907-regulator.o
drivers/regulator/max8907-regulator.c: In function 'max8907_regulator_remove':
drivers/regulator/max8907-regulator.c:353:23: warning: 'pmic' is used uninitialized in this function [-Wuninitialized]

---
 drivers/regulator/max8907-regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max8907-regulator.c +1 -1
index bd3b28b..831488f 100644
@@ -346,7 +346,7 @@ err_unregister_regulator:
 
 static __devexit int max8907_regulator_remove(struct platform_device *pdev)
 {
-	struct max8907_regulator *pmic;
+	struct max8907_regulator *pmic = platform_get_drvdata(pdev);
 	int i;
 
 	for (i = 0; i < MAX8907_NUM_REGULATORS; i++)
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Axel Lin

Add missing platform_get_drvdata() call in max8907_regulator_remove(), this fixes below build warning:

CC [M] drivers/regulator/max8907-regulator.o
drivers/regulator/max8907-regulator.c: In function 'max8907_regulator_remove':
drivers/regulator/max8907-regulator.c:353:23: warning: 'pmic' is used uninitialized in this function [-Wuninitialized]

That's odd; while this warning and the patch are obviously correct, I can't get my compiler to warn about it at all, and it usually is pretty strict about emitting warnings. Oh well.

author
#2 lore raw

2012/8/20 Stephen Warren <[email protected]>:

Quoted 11 lines · Axel Lin
Quoted 6 lines

Add missing platform_get_drvdata() call in max8907_regulator_remove(), this fixes below build warning:

CC [M] drivers/regulator/max8907-regulator.o
drivers/regulator/max8907-regulator.c: In function 'max8907_regulator_remove':
drivers/regulator/max8907-regulator.c:353:23: warning: 'pmic' is used uninitialized in this function [-Wuninitialized]

That's odd; while this warning and the patch are obviously correct, I can't get my compiler to warn about it at all, and it usually is pretty strict about emitting warnings. Oh well.

I got this error message only when I compile it as a module. :-)

Axel

Applied
#3 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

Add missing platform_get_drvdata() call in max8907_regulator_remove(), this fixes below build warning:

Applied, thanks.