mfd: aat2870: Update the driver to new mfd core
Jin Park [Wed, 28 Sep 2011 08:13:03 +0000 (17:13 +0900)]
The mfd core was updated that removed size_t data_size and
renamed void *platform_data to void *mfd_data in struct mfd_cell.
The new mfd API, mfd_get_data(), was added for mfd device.
It return from struct platform_device to right value of mfd_data
and platform_data.

Change-Id: I9b61d0ac0139be840c328fc0b266752d27815cf5
Signed-off-by: Jin Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/54912
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: Rc0b7b7d376c1bab14eab86a9bdfa4cd5b970bbf8

drivers/mfd/aat2870-core.c
drivers/regulator/aat2870-regulator.c
drivers/video/backlight/aat2870_bl.c

index 345dc65..e7a4e2a 100644 (file)
@@ -79,27 +79,22 @@ static struct mfd_cell aat2870_devs[] = {
        {
                .name = "aat2870-backlight",
                .id = AAT2870_ID_BL,
-               .pdata_size = sizeof(struct aat2870_bl_platform_data),
        },
        {
                .name = "aat2870-regulator",
                .id = AAT2870_ID_LDOA,
-               .pdata_size = sizeof(struct regulator_init_data),
        },
        {
                .name = "aat2870-regulator",
                .id = AAT2870_ID_LDOB,
-               .pdata_size = sizeof(struct regulator_init_data),
        },
        {
                .name = "aat2870-regulator",
                .id = AAT2870_ID_LDOC,
-               .pdata_size = sizeof(struct regulator_init_data),
        },
        {
                .name = "aat2870-regulator",
                .id = AAT2870_ID_LDOD,
-               .pdata_size = sizeof(struct regulator_init_data),
        },
 };
 
@@ -423,7 +418,7 @@ static int aat2870_i2c_probe(struct i2c_client *client,
                        if ((pdata->subdevs[i].id == aat2870_devs[j].id) &&
                                        !strcmp(pdata->subdevs[i].name,
                                                aat2870_devs[j].name)) {
-                               aat2870_devs[j].platform_data =
+                               aat2870_devs[j].mfd_data =
                                        pdata->subdevs[i].platform_data;
                                break;
                        }
index cd41045..cc99c67 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/mfd/core.h>
 #include <linux/mfd/aat2870.h>
 
 struct aat2870_regulator {
@@ -186,8 +187,8 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
        }
        ri->pdev = pdev;
 
-       rdev = regulator_register(&ri->desc, &pdev->dev,
-                                 pdev->dev.platform_data, ri);
+       rdev = regulator_register(&ri->desc, &pdev->dev, mfd_get_data(pdev),
+                                 ri);
        if (IS_ERR(rdev)) {
                dev_err(&pdev->dev, "Failed to register regulator %s\n",
                        ri->desc.name);
index 331f1ef..203eaa6 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
+#include <linux/mfd/core.h>
 #include <linux/mfd/aat2870.h>
 
 struct aat2870_bl_driver_data {
@@ -127,7 +128,7 @@ static const struct backlight_ops aat2870_bl_ops = {
 
 static int aat2870_bl_probe(struct platform_device *pdev)
 {
-       struct aat2870_bl_platform_data *pdata = pdev->dev.platform_data;
+       struct aat2870_bl_platform_data *pdata = mfd_get_data(pdev);
        struct aat2870_bl_driver_data *aat2870_bl;
        struct backlight_device *bd;
        struct backlight_properties props;