aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-12 14:25:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-12 14:25:10 -0700
commite328f05dd6c528fcc9eb6da157dd865dfe611352 (patch)
treec2bfbdada67dd80a8eed5aeafbe0d7322b1c1b2a /drivers
parentnfs: don't call __mark_inode_dirty while holding i_lock (diff)
parentmfd: Fetch cell pointer from platform_device->mfd_cell (diff)
downloadlinux-dev-e328f05dd6c528fcc9eb6da157dd865dfe611352.tar.xz
linux-dev-e328f05dd6c528fcc9eb6da157dd865dfe611352.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: mfd: Fetch cell pointer from platform_device->mfd_cell
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/platform.c1
-rw-r--r--drivers/mfd/mfd-core.c16
2 files changed, 15 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index f051cfff18af..6c3a2bdc527a 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -149,6 +149,7 @@ static void platform_device_release(struct device *dev)
of_device_node_put(&pa->pdev.dev);
kfree(pa->pdev.dev.platform_data);
+ kfree(pa->pdev.mfd_cell);
kfree(pa->pdev.resource);
kfree(pa);
}
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index d01574d98870..f4c8c844b913 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -55,6 +55,19 @@ int mfd_cell_disable(struct platform_device *pdev)
}
EXPORT_SYMBOL(mfd_cell_disable);
+static int mfd_platform_add_cell(struct platform_device *pdev,
+ const struct mfd_cell *cell)
+{
+ if (!cell)
+ return 0;
+
+ pdev->mfd_cell = kmemdup(cell, sizeof(*cell), GFP_KERNEL);
+ if (!pdev->mfd_cell)
+ return -ENOMEM;
+
+ return 0;
+}
+
static int mfd_add_device(struct device *parent, int id,
const struct mfd_cell *cell,
struct resource *mem_base,
@@ -75,7 +88,7 @@ static int mfd_add_device(struct device *parent, int id,
pdev->dev.parent = parent;
- ret = platform_device_add_data(pdev, cell, sizeof(*cell));
+ ret = mfd_platform_add_cell(pdev, cell);
if (ret)
goto fail_res;
@@ -123,7 +136,6 @@ static int mfd_add_device(struct device *parent, int id,
return 0;
-/* platform_device_del(pdev); */
fail_res:
kfree(res);
fail_device: