regulator: Fix build error for mc13783 and mc13892
authorAxel Lin <axel.lin@gmail.com>
Tue, 10 Apr 2012 05:51:06 +0000 (13:51 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 Apr 2012 08:52:53 +0000 (09:52 +0100)
Convert mc13783 and mc13892 to use a struct to pass in regulator runtime
configuration.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/mc13783-regulator.c
drivers/regulator/mc13892-regulator.c

index 6c0face87ffe834db5d69fb19d85f3e1d4ace9b5..7dcdfa283e9368c8bfa492a2104b516dc363d991 100644 (file)
@@ -340,6 +340,7 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
        struct mc13xxx_regulator_platform_data *pdata =
                dev_get_platdata(&pdev->dev);
        struct mc13xxx_regulator_init_data *init_data;
+       struct regulator_config config = { };
        int i, ret;
 
        dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id);
@@ -357,11 +358,16 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
        priv->mc13xxx = mc13783;
 
        for (i = 0; i < pdata->num_regulators; i++) {
+               struct regulator_desc *desc;
+
                init_data = &pdata->regulators[i];
-               priv->regulators[i] = regulator_register(
-                               &mc13783_regulators[init_data->id].desc,
-                               &pdev->dev, init_data->init_data, priv, NULL);
+               desc = &mc13783_regulators[init_data->id].desc;
+
+               config.dev = &pdev->dev;
+               config.init_data = init_data->init_data;
+               config.driver_data = priv;
 
+               priv->regulators[i] = regulator_register(desc, &config);
                if (IS_ERR(priv->regulators[i])) {
                        dev_err(&pdev->dev, "failed to register regulator %s\n",
                                mc13783_regulators[i].desc.name);
index ba5868179261ae95d88f00462cb0f98f18b008c7..6622228a0d86f9ffda832243f0ef881bf619b328 100644 (file)
@@ -519,6 +519,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
        struct mc13xxx_regulator_platform_data *pdata =
                dev_get_platdata(&pdev->dev);
        struct mc13xxx_regulator_init_data *mc13xxx_data;
+       struct regulator_config config = { };
        int i, ret;
        int num_regulators = 0;
        u32 val;
@@ -588,9 +589,12 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
                }
                desc = &mc13892_regulators[id].desc;
 
-               priv->regulators[i] = regulator_register(
-                       desc, &pdev->dev, init_data, priv, node);
+               config.dev = &pdev->dev;
+               config.init_data = init_data;
+               config.driver_data = priv;
+               config.of_node = node;
 
+               priv->regulators[i] = regulator_register(desc, &config);
                if (IS_ERR(priv->regulators[i])) {
                        dev_err(&pdev->dev, "failed to register regulator %s\n",
                                mc13892_regulators[i].desc.name);