All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
@ 2013-06-28 13:32 Axel Lin
  2013-06-28 13:34 ` [PATCH 2/2] regulator: 88pm800: Remove NULL test for regulator_unregister() Axel Lin
  2013-06-28 13:50 ` [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Axel Lin @ 2013-06-28 13:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: Yi Zhang, Chao Xie, Liam Girdwood, linux-kernel

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi,
Seems current code also needs this patch:
	mfd: 88pm800: add regulator sub device [1]

Otherwise, I got build error:
  CC      drivers/regulator/88pm800.o
drivers/regulator/88pm800.c: In function 'pm800_regulator_probe':
drivers/regulator/88pm800.c:356:21: error: 'struct pm80x_platform_data' has no member named 'num_regulators'
drivers/regulator/88pm800.c:364:18: error: 'struct pm80x_platform_data' has no member named 'num_regulators'
drivers/regulator/88pm800.c:367:20: error: 'struct pm80x_platform_data' has no member named 'regulators'
drivers/regulator/88pm800.c:369:21: error: 'struct pm80x_platform_data' has no member named 'num_regulators'
drivers/regulator/88pm800.c:388:22: error: 'struct pm80x_platform_data' has no member named 'num_regulators'
drivers/regulator/88pm800.c:391:21: error: 'struct pm80x_platform_data' has no member named 'regulators'
make[2]: *** [drivers/regulator/88pm800.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2

[1] https://lkml.org/lkml/2013/6/14/21.

 drivers/regulator/88pm800.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index ed704ca..afa3762 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -396,6 +396,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		config.init_data = init_data;
 		config.driver_data = info;
 		config.regmap = pm800_data->map;
+		config.of_node = pm800_regulator_matches[i].of_node;
 
 		pm800_data->regulators[i] =
 				regulator_register(&info->desc, &config);
-- 
1.8.1.2




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

* [PATCH 2/2] regulator: 88pm800: Remove NULL test for regulator_unregister()
  2013-06-28 13:32 [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Axel Lin
@ 2013-06-28 13:34 ` Axel Lin
  2013-06-28 13:50 ` [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Axel Lin @ 2013-06-28 13:34 UTC (permalink / raw)
  To: Mark Brown; +Cc: Yi Zhang, Chao Xie, Liam Girdwood, linux-kernel

It's safe to call regulator_unregister with NULL.
In additional, having NULL check in the for loop is wrong because
the for loop exits if pm800_data->regulators[i] is NULL.
So we have have some regulators remains registered.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/88pm800.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index afa3762..1fc1899 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -405,7 +405,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "Failed to register %s\n",
 				info->desc.name);
 
-			while (--i >= 0 && pm800_data->regulators[i])
+			while (--i >= 0)
 				regulator_unregister(pm800_data->regulators[i]);
 
 			return ret;
@@ -420,7 +420,7 @@ static int pm800_regulator_remove(struct platform_device *pdev)
 	struct pm800_regulators *pm800_data = platform_get_drvdata(pdev);
 	int i;
 
-	for (i = 0; pm800_data->regulators[i] && i < PM800_ID_RG_MAX; i++)
+	for (i = 0; i < PM800_ID_RG_MAX; i++)
 		regulator_unregister(pm800_data->regulators[i]);
 
 	return 0;
-- 
1.8.1.2




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

* Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
  2013-06-28 13:32 [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Axel Lin
  2013-06-28 13:34 ` [PATCH 2/2] regulator: 88pm800: Remove NULL test for regulator_unregister() Axel Lin
@ 2013-06-28 13:50 ` Mark Brown
  2013-07-01  2:14   ` Chao Xie
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2013-06-28 13:50 UTC (permalink / raw)
  To: Axel Lin; +Cc: Yi Zhang, Chao Xie, Liam Girdwood, linux-kernel

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

On Fri, Jun 28, 2013 at 09:32:34PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi,
> Seems current code also needs this patch:
> 	mfd: 88pm800: add regulator sub device [1]

Oh dear.  I've just reverted the patch (my build testing hadn't caught
up yet).  Chao, please resubmit for v3.12 - when you submit patches you
need to either ensure it applies and builds on the relevant branch or
mention the dependencies so that the build doesn't break.  In this case
sending the regulator driver and matching MFD changes as a single patch
series would have been the normal thing.

Please incorporate Axel's feedback into any resubmission.

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

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

* RE: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
  2013-06-28 13:50 ` [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Mark Brown
@ 2013-07-01  2:14   ` Chao Xie
  2013-07-01  8:46     ` Mark Brown
  2013-07-01  8:46     ` Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Chao Xie @ 2013-07-01  2:14 UTC (permalink / raw)
  To: Mark Brown, Axel Lin; +Cc: Yi Zhang, Liam Girdwood, linux-kernel

> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org] 
> Sent: Friday, June 28, 2013 9:50 PM
> To: Axel Lin
> Cc: Yi Zhang; Chao Xie; Liam Girdwood; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
> 
> On Fri, Jun 28, 2013 at 09:32:34PM +0800, Axel Lin wrote:
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>> ---
>> Hi,
>> Seems current code also needs this patch:
>> 	mfd: 88pm800: add regulator sub device [1]
>
> Oh dear.  I've just reverted the patch (my build testing hadn't caught up yet).  Chao, please resubmit for v3.12 - when you submit patches you need to either ensure it applies and builds on the relevant branch or mention the dependencies so that the build doesn't break.  In this case sending the regulator driver and matching MFD changes as a single patch series would have been the normal thing.
> 
> Please incorporate Axel's feedback into any resubmission.
It is my mistake. I should add "regulator_data" and "num_regulator" with regulator driver.
I have seen that mfd: 88pm800: add regulator sub device is already merged into Linux-next. So you mean that I need wait for 3.11 to release, then resubmit the regulator patch?

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

* Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
  2013-07-01  2:14   ` Chao Xie
@ 2013-07-01  8:46     ` Mark Brown
  2013-07-01  8:46     ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2013-07-01  8:46 UTC (permalink / raw)
  To: Chao Xie; +Cc: Axel Lin, Yi Zhang, Liam Girdwood, linux-kernel

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

On Sun, Jun 30, 2013 at 07:14:55PM -0700, Chao Xie wrote:

Please fix your mailer to word wrap within paragraphs.

> I have seen that mfd: 88pm800: add regulator sub device is already
> merged into Linux-next. So you mean that I need wait for 3.11 to
> release, then resubmit the regulator patch?

Yes, that should be fine.

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

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

* Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
  2013-07-01  2:14   ` Chao Xie
  2013-07-01  8:46     ` Mark Brown
@ 2013-07-01  8:46     ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2013-07-01  8:46 UTC (permalink / raw)
  To: Chao Xie; +Cc: Axel Lin, Yi Zhang, Liam Girdwood, linux-kernel

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

On Sun, Jun 30, 2013 at 07:14:55PM -0700, Chao Xie wrote:

> I have seen that mfd: 88pm800: add regulator sub device is already
> merged into Linux-next. So you mean that I need wait for 3.11 to
> release, then resubmit the regulator patch?

Sorry, just realised you said v3.11 - waiting till the merge window is
over is enough.

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

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

* Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
  2013-07-19  1:16 Axel Lin
@ 2013-07-19 17:24 ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2013-07-19 17:24 UTC (permalink / raw)
  To: Axel Lin; +Cc: Yi Zhang, Chao Xie, Liam Girdwood, linux-kernel

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

On Fri, Jul 19, 2013 at 09:16:55AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied both, thanks.

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

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

* [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register
@ 2013-07-19  1:16 Axel Lin
  2013-07-19 17:24 ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Lin @ 2013-07-19  1:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: Yi Zhang, Chao Xie, Liam Girdwood, linux-kernel

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/88pm800.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index a7d962f..fc0c352 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -331,6 +331,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		config.init_data = init_data;
 		config.driver_data = info;
 		config.regmap = pm800_data->map;
+		config.of_node = pm800_regulator_matches[i].of_node;
 
 		pm800_data->regulators[i] =
 				regulator_register(&info->desc, &config);
-- 
1.8.1.2




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

end of thread, other threads:[~2013-07-19 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 13:32 [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Axel Lin
2013-06-28 13:34 ` [PATCH 2/2] regulator: 88pm800: Remove NULL test for regulator_unregister() Axel Lin
2013-06-28 13:50 ` [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register Mark Brown
2013-07-01  2:14   ` Chao Xie
2013-07-01  8:46     ` Mark Brown
2013-07-01  8:46     ` Mark Brown
2013-07-19  1:16 Axel Lin
2013-07-19 17:24 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.