Skip to content

Commit eb89560

Browse files
author
Samuel Ortiz
committed
mfd: Add platform data pointer back
Now that we have a way to pass MFD cells down to the sub drivers, we can gradually get rid of mfd_data by putting the platform pointer back in place. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 4db70f7 commit eb89560

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎drivers/mfd/mfd-core.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ static int mfd_add_device(struct device *parent, int id,
8888

8989
pdev->dev.parent = parent;
9090

91+
if (cell->pdata_size) {
92+
ret = platform_device_add_data(pdev,
93+
cell->platform_data, cell->pdata_size);
94+
if (ret)
95+
goto fail_res;
96+
}
97+
9198
ret = mfd_platform_add_cell(pdev, cell);
9299
if (ret)
93100
goto fail_res;

‎include/linux/mfd/core.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ struct mfd_cell {
3636
/* mfd_data can be used to pass data to client drivers */
3737
void *mfd_data;
3838

39+
/* platform data passed to the sub devices drivers */
40+
void *platform_data;
41+
size_t pdata_size;
42+
3943
/*
4044
* These resources can be specified relative to the parent device.
4145
* For accessing hardware you should use resources from the platform dev

0 commit comments

Comments
 (0)