diff options
| author | Ingo Molnar <mingo@elte.hu> | 2011-04-18 14:53:18 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2011-04-18 14:53:33 +0200 |
| commit | 6ddafdaab3f809b110ada253d2f2d4910ebd3ac5 (patch) | |
| tree | 366bb7513511a05b6e11ab89bfe3b2dbd1d62a03 /include/linux/mfd/core.h | |
| parent | 3905c54f2bd2c6f937f87307987ca072eabc3e7b (diff) | |
| parent | bd8e7dded88a3e1c085c333f19ff31387616f71a (diff) | |
Merge branch 'sched/locking' into sched/core
Merge reason: the rq locking changes are stable,
propagate them into the .40 queue.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/mfd/core.h')
| -rw-r--r-- | include/linux/mfd/core.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index ad1b19aa6508..aef23309a742 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -86,16 +86,25 @@ extern int mfd_clone_cell(const char *cell, const char **clones, */ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) { - return pdev->dev.platform_data; + return pdev->mfd_cell; } /* * Given a platform device that's been created by mfd_add_devices(), fetch * the .mfd_data entry from the mfd_cell that created it. + * Otherwise just return the platform_data pointer. + * This maintains compatibility with platform drivers whose devices aren't + * created by the mfd layer, and expect platform_data to contain what would've + * otherwise been in mfd_data. */ static inline void *mfd_get_data(struct platform_device *pdev) { - return mfd_get_cell(pdev)->mfd_data; + const struct mfd_cell *cell = mfd_get_cell(pdev); + + if (cell) + return cell->mfd_data; + else + return pdev->dev.platform_data; } extern int mfd_add_devices(struct device *parent, int id, |
