diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2011-04-06 10:52:52 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:44:56 -0400 |
commit | eb8956074e7652e802be5f078080c704c2c87104 (patch) | |
tree | b96a4eaaf69e36a6a88282fa9572e194c5f5a1ba | |
parent | 4db70f73e56961b9bcdfd0c36c62847a18b7dbb5 (diff) |
mfd: Add platform data pointer back
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>
-rw-r--r-- | drivers/mfd/mfd-core.c | 7 | ||||
-rw-r--r-- | include/linux/mfd/core.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index f4c8c844b913..0902523af62d 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c | |||
@@ -88,6 +88,13 @@ static int mfd_add_device(struct device *parent, int id, | |||
88 | 88 | ||
89 | pdev->dev.parent = parent; | 89 | pdev->dev.parent = parent; |
90 | 90 | ||
91 | if (cell->pdata_size) { | ||
92 | ret = platform_device_add_data(pdev, | ||
93 | cell->platform_data, cell->pdata_size); | ||
94 | if (ret) | ||
95 | goto fail_res; | ||
96 | } | ||
97 | |||
91 | ret = mfd_platform_add_cell(pdev, cell); | 98 | ret = mfd_platform_add_cell(pdev, cell); |
92 | if (ret) | 99 | if (ret) |
93 | goto fail_res; | 100 | goto fail_res; |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index aef23309a742..68c13e52a50c 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -36,6 +36,10 @@ struct mfd_cell { | |||
36 | /* mfd_data can be used to pass data to client drivers */ | 36 | /* mfd_data can be used to pass data to client drivers */ |
37 | void *mfd_data; | 37 | void *mfd_data; |
38 | 38 | ||
39 | /* platform data passed to the sub devices drivers */ | ||
40 | void *platform_data; | ||
41 | size_t pdata_size; | ||
42 | |||
39 | /* | 43 | /* |
40 | * These resources can be specified relative to the parent device. | 44 | * These resources can be specified relative to the parent device. |
41 | * For accessing hardware you should use resources from the platform dev | 45 | * For accessing hardware you should use resources from the platform dev |