2013-06-28 13:32:42

by Axel Lin

[permalink] [raw]
Subject: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register

Signed-off-by: Axel Lin <[email protected]>
---
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



2013-06-28 13:34:21

by Axel Lin

[permalink] [raw]
Subject: [PATCH 2/2] regulator: 88pm800: Remove NULL test for regulator_unregister()

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 <[email protected]>
---
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


2013-06-28 13:50:31

by Mark Brown

[permalink] [raw]
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 <[email protected]>
> ---
> 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.


Attachments:
(No filename) (666.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-07-01 02:18:47

by Chao Xie

[permalink] [raw]
Subject: RE: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register

> -----Original Message-----
> From: Mark Brown [mailto:[email protected]]
> Sent: Friday, June 28, 2013 9:50 PM
> To: Axel Lin
> Cc: Yi Zhang; Chao Xie; Liam Girdwood; [email protected]
> 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 <[email protected]>
>> ---
>> 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?

2013-07-01 08:46:47

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register

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.


Attachments:
(No filename) (324.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-07-01 08:47:34

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register

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.


Attachments:
(No filename) (329.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments