mfd: Add platform data pointer back
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 6 Apr 2011 14:52:52 +0000 (16:52 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 26 May 2011 17:44:56 +0000 (19:44 +0200)
Now that we have a way to pass MFD cells down to the sub drivers,
we can gradually get rid of mfd_data by putting the platform pointer
back in place.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/mfd-core.c
include/linux/mfd/core.h

index f4c8c844b913060c6e0bb12f35db8cba983a81dc..0902523af62d47e33e139c1feab75e5b0ef2a49c 100644 (file)
@@ -88,6 +88,13 @@ static int mfd_add_device(struct device *parent, int id,
 
        pdev->dev.parent = parent;
 
+       if (cell->pdata_size) {
+               ret = platform_device_add_data(pdev,
+                                       cell->platform_data, cell->pdata_size);
+               if (ret)
+                       goto fail_res;
+       }
+
        ret = mfd_platform_add_cell(pdev, cell);
        if (ret)
                goto fail_res;
index aef23309a742334d9f3fb33d3f3b5af38b7f024d..68c13e52a50c7633ab22959361e2b7e10a8cfa41 100644 (file)
@@ -36,6 +36,10 @@ struct mfd_cell {
        /* mfd_data can be used to pass data to client drivers */
        void                    *mfd_data;
 
+       /* platform data passed to the sub devices drivers */
+       void                    *platform_data;
+       size_t                  pdata_size;
+
        /*
         * These resources can be specified relative to the parent device.
         * For accessing hardware you should use resources from the platform dev