summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mfd-core.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2008-07-29 01:30:26 +0200
committerSamuel Ortiz <sameo@openedhand.com>2008-07-29 01:30:26 +0200
commit424f525a1241351da947fb48a938128ddd774511 (patch)
treee837c0f6b15a3efe38bb0aa3db5a46305e5a9f38 /drivers/mfd/mfd-core.c
parent56edb58be157a06dc147a988af3588059556d392 (diff)
downloadop-kernel-dev-424f525a1241351da947fb48a938128ddd774511.zip
op-kernel-dev-424f525a1241351da947fb48a938128ddd774511.tar.gz
mfd: accept pure device as a parent, not only platform_device
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'drivers/mfd/mfd-core.c')
-rw-r--r--drivers/mfd/mfd-core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index ad4e4d1..9c9c126 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -15,7 +15,7 @@
#include <linux/platform_device.h>
#include <linux/mfd/core.h>
-static int mfd_add_device(struct platform_device *parent,
+static int mfd_add_device(struct device *parent, int id,
const struct mfd_cell *cell,
struct resource *mem_base,
int irq_base)
@@ -25,11 +25,11 @@ static int mfd_add_device(struct platform_device *parent,
int ret = -ENOMEM;
int r;
- pdev = platform_device_alloc(cell->name, parent->id);
+ pdev = platform_device_alloc(cell->name, id);
if (!pdev)
goto fail_alloc;
- pdev->dev.parent = &parent->dev;
+ pdev->dev.parent = parent;
ret = platform_device_add_data(pdev,
cell->platform_data, cell->data_size);
@@ -75,7 +75,7 @@ fail_alloc:
return ret;
}
-int mfd_add_devices(struct platform_device *parent,
+int mfd_add_devices(struct device *parent, int id,
const struct mfd_cell *cells, int n_devs,
struct resource *mem_base,
int irq_base)
@@ -84,7 +84,7 @@ int mfd_add_devices(struct platform_device *parent,
int ret = 0;
for (i = 0; i < n_devs; i++) {
- ret = mfd_add_device(parent, cells + i, mem_base, irq_base);
+ ret = mfd_add_device(parent, id, cells + i, mem_base, irq_base);
if (ret)
break;
}
@@ -102,9 +102,9 @@ static int mfd_remove_devices_fn(struct device *dev, void *unused)
return 0;
}
-void mfd_remove_devices(struct platform_device *parent)
+void mfd_remove_devices(struct device *parent)
{
- device_for_each_child(&parent->dev, NULL, mfd_remove_devices_fn);
+ device_for_each_child(parent, NULL, mfd_remove_devices_fn);
}
EXPORT_SYMBOL(mfd_remove_devices);
OpenPOWER on IntegriCloud