14 #include <linux/kernel.h>
19 #include <linux/slab.h>
20 #include <linux/module.h>
26 const struct mfd_cell *cell = mfd_get_cell(pdev);
43 const struct mfd_cell *cell = mfd_get_cell(pdev);
74 static int mfd_add_device(
struct device *parent,
int id,
98 pdev->
dev.of_node = np;
111 ret = mfd_platform_add_cell(pdev, cell);
136 res[
r].
end = irq_base +
185 cnts = kcalloc(n_devs,
sizeof(*cnts),
GFP_KERNEL);
189 for (i = 0; i < n_devs; i++) {
192 ret = mfd_add_device(parent,
id, cells + i, mem_base,
205 static int mfd_remove_devices_fn(
struct device *
dev,
void *
c)
208 const struct mfd_cell *cell = mfd_get_cell(pdev);
212 if (!*usage_count || (cell->
usage_count < *usage_count))
242 memcpy(&cell_entry, mfd_get_cell(pdev),
sizeof(cell_entry));
246 for (i = 0; i < n_clones; i++) {
247 cell_entry.
name = clones[
i];
249 if (mfd_add_device(pdev->
dev.parent, -1, &cell_entry,
NULL, 0,
251 dev_err(dev,
"failed to create platform device '%s'\n",