linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()
@ 2012-08-18  6:33 Axel Lin
  2012-08-20 15:01 ` Stephen Warren
  2012-08-20 19:58 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2012-08-18  6:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, linux-kernel, Gyungoh Yoo, Stephen Warren,
	Laxman Dewangan

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]

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/max8907-regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index bd3b28b..831488f 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -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++)
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()
  2012-08-18  6:33 [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove() Axel Lin
@ 2012-08-20 15:01 ` Stephen Warren
  2012-08-21  3:36   ` Axel Lin
  2012-08-20 19:58 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Warren @ 2012-08-20 15:01 UTC (permalink / raw)
  To: Axel Lin
  Cc: Mark Brown, Liam Girdwood, linux-kernel, Gyungoh Yoo,
	Stephen Warren, Laxman Dewangan

On 08/18/2012 12:33 AM, Axel Lin wrote:
> 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.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()
  2012-08-18  6:33 [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove() Axel Lin
  2012-08-20 15:01 ` Stephen Warren
@ 2012-08-20 19:58 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-08-20 19:58 UTC (permalink / raw)
  To: Axel Lin
  Cc: Liam Girdwood, linux-kernel, Gyungoh Yoo, Stephen Warren,
	Laxman Dewangan

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

On Sat, Aug 18, 2012 at 02:33:05PM +0800, Axel Lin wrote:
> Add missing platform_get_drvdata() call in max8907_regulator_remove(), this
> fixes below build warning:

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()
  2012-08-20 15:01 ` Stephen Warren
@ 2012-08-21  3:36   ` Axel Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2012-08-21  3:36 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Mark Brown, Liam Girdwood, linux-kernel, Gyungoh Yoo,
	Stephen Warren, Laxman Dewangan

2012/8/20 Stephen Warren <swarren@wwwdotorg.org>:
> On 08/18/2012 12:33 AM, Axel Lin wrote:
>> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-21  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-18  6:33 [PATCH] regulator: max8907: Properly set pmic pointer in max8907_regulator_remove() Axel Lin
2012-08-20 15:01 ` Stephen Warren
2012-08-21  3:36   ` Axel Lin
2012-08-20 19:58 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).