[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1303135451-26362-15-git-send-email-haojian.zhuang@marvell.com>
Date: Mon, 18 Apr 2011 22:04:11 +0800
From: Haojian Zhuang <haojian.zhuang@...vell.com>
To: sameo@...ux.intel.com, haojian.zhuang@...il.com,
linux-kernel@...r.kernel.org, dmitry.torokhov@...il.com,
a.zummo@...ertech.it, johnpol@....mipt.ru, cbou@...l.ru,
dwmw2@...radead.org, lrg@...mlogic.co.uk,
broonie@...nsource.wolfsonmicro.com
Cc: Haojian Zhuang <haojian.zhuang@...vell.com>
Subject: [PATCH 14/14] regulator: 88pm8607: avoid to use constraint name in driver
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@...vell.com>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>
Cc: Mark Brown <broonie@...nsource.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists