w1: Use device platform_data to retrieve ds1wm platform bits
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 6 Apr 2011 09:41:03 +0000 (11:41 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 26 May 2011 17:45:00 +0000 (19:45 +0200)
With the addition of the platform device mfd_cell pointer, we can now
cleanly pass the sub device drivers platform data pointers through the
regular device platform_data one, and get rid of mfd_get_data().

Cc: Matt Reimer <mreimer@vpop.net>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/asic3.c
drivers/mfd/htc-pasic3.c
drivers/w1/masters/ds1wm.c

index a26280240bb9ac66d9d3215f71fd04f774f9e015..77a3971e00bdd8dcc99a2c85ec78ca21e6e74f31 100644 (file)
@@ -676,7 +676,8 @@ static struct mfd_cell asic3_cell_ds1wm = {
        .name          = "ds1wm",
        .enable        = ds1wm_enable,
        .disable       = ds1wm_disable,
-       .mfd_data      = &ds1wm_pdata,
+       .platform_data = &ds1wm_pdata,
+       .pdata_size    = sizeof(ds1wm_pdata),
        .num_resources = ARRAY_SIZE(ds1wm_resources),
        .resources     = ds1wm_resources,
 };
index fb9770b39a3253edcc92a83a3e77fb020b72b93f..95a4ff48b282bc3cb6ecc3019b16c073d369829b 100644 (file)
@@ -117,7 +117,8 @@ static struct mfd_cell ds1wm_cell __initdata = {
        .name          = "ds1wm",
        .enable        = ds1wm_enable,
        .disable       = ds1wm_disable,
-       .mfd_data      = &ds1wm_pdata,
+       .platform_data = &ds1wm_pdata,
+       .pdata_size    = sizeof(ds1wm_pdata),
        .num_resources = 2,
        .resources     = ds1wm_resources,
 };
index 2f4fa02744a5680673625f48192a7111008053a3..0855d6cce3c1f80a688d0cc687b717cbc05eec76 100644 (file)
@@ -216,7 +216,7 @@ static int ds1wm_find_divisor(int gclk)
 static void ds1wm_up(struct ds1wm_data *ds1wm_data)
 {
        int divisor;
-       struct ds1wm_driver_data *plat = mfd_get_data(ds1wm_data->pdev);
+       struct ds1wm_driver_data *plat = ds1wm_data->pdev->dev.platform_data;
 
        if (ds1wm_data->cell->enable)
                ds1wm_data->cell->enable(ds1wm_data->pdev);
@@ -351,13 +351,21 @@ static int ds1wm_probe(struct platform_device *pdev)
                ret = -ENOMEM;
                goto err0;
        }
-       plat = mfd_get_data(pdev);
 
        /* calculate bus shift from mem resource */
        ds1wm_data->bus_shift = resource_size(res) >> 3;
 
        ds1wm_data->pdev = pdev;
        ds1wm_data->cell = mfd_get_cell(pdev);
+       if (!ds1wm_data->cell) {
+               ret = -ENODEV;
+               goto err1;
+       }
+       plat = pdev->dev.platform_data;
+       if (!plat) {
+               ret = -ENODEV;
+               goto err1;
+       }
 
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!res) {