lkml.org 
[lkml]   [2011]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 14/14] regulator: 88pm8607: avoid to use constraint name in driver
Date
Avoid to use constraint name in driver. So use driver_data instead to
store regulator name in platform driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/regulator/88pm8607.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index 784ea77..63fc34e 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -402,12 +402,13 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
int i;

pdata = pdev->dev.platform_data;
- if (pdata == NULL)
+ if ((pdata == NULL) || (pdata->driver_data == NULL))
return -EINVAL;

for (i = 0; i < ARRAY_SIZE(pm8607_regulator_info); i++) {
info = &pm8607_regulator_info[i];
- if (!strcmp(info->desc.name, pdata->constraints.name))
+ /* pdata->driver_data stores the name of regulator */
+ if (!strcmp(info->desc.name, pdata->driver_data))
break;
}
if (i > ARRAY_SIZE(pm8607_regulator_info)) {
@@ -424,6 +425,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
if (info->chip->buck3_double)
info->slope_double = 1;

+ /* replace driver_data with info */
info->regulator = regulator_register(&info->desc, &pdev->dev,
pdata, info);
if (IS_ERR(info->regulator)) {
--
1.5.6.5


\
 
 \ /
  Last update: 2011-04-18 16:13    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site