regulator: 88pm800: Add missing config.of_node setting for regulator register
PATCH 1/2 regulator: 88pm800: Add missing config.of_node setting for regulator register
---
Hi,
Seems current code also needs this patch:
mfd: 88pm800: add regulator sub device [1]
Otherwise, I got build error:
CC drivers/regulator/88pm800.odrivers/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(+)
drivers/regulator/88pm800.c +1 -0
@@ -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);
Signature · 1 line
1.8.1.2
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.
--- drivers/regulator/88pm800.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/88pm800.c +2 -2
@@ -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 ;
Signature · 1 line
1.8.1.2
Mark Brown
maintainerQuoted 5 lines · Axel Lin
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.
Quoted 14 lines
-----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 registerQuoted 5 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>---
Hi,
Seems current code also needs this patch:
mfd: 88pm800: add regulator sub device [1]
Quoted 3 lines
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?
Mark Brown
maintainerOn Sun, Jun 30, 2013 at 07:14:55PM -0700, Chao Xie wrote:
Please fix your mailer to word wrap within paragraphs.
Quoted 3 lines
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.
Mark Brown
maintainerQuoted 3 lines · Chao Xie
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.