mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mfd: add platform_data to mfd_cell
Adding platform_data to mfd_cell allows passing of platform data directly to the platform_device created for each cell and thus reuse of existing drivers. On the other side it can be used as a hook to mfd_cell itself removing the need in mfd_get_cell method. Signed-off-by: Mike Rapoport <[email protected]> Acked-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
7f71ac9374
commit
56edb58be1
3 changed files with 12 additions and 7 deletions
|
|
@ -32,7 +32,7 @@ static int mfd_add_device(struct platform_device *parent,
|
|||
pdev->dev.parent = &parent->dev;
|
||||
|
||||
ret = platform_device_add_data(pdev,
|
||||
cell, sizeof(struct mfd_cell));
|
||||
cell->platform_data, cell->data_size);
|
||||
if (ret)
|
||||
goto fail_device;
|
||||
|
||||
|
|
|
|||
|
|
@ -466,6 +466,10 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)
|
|||
tc6393xb_attach_irq(dev);
|
||||
|
||||
tc6393xb_cells[TC6393XB_CELL_NAND].driver_data = tcpd->nand_data;
|
||||
tc6393xb_cells[TC6393XB_CELL_NAND].platform_data =
|
||||
&tc6393xb_cells[TC6393XB_CELL_NAND];
|
||||
tc6393xb_cells[TC6393XB_CELL_NAND].data_size =
|
||||
sizeof(tc6393xb_cells[TC6393XB_CELL_NAND]);
|
||||
|
||||
retval = mfd_add_devices(dev,
|
||||
tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells),
|
||||
|
|
|
|||
Loading…
Reference in a new issue