Skip to content

Commit

Permalink
mfd: Add platform data pointer back
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed May 26, 2011
1 parent 4db70f7 commit eb89560
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mfd/mfd-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ static int mfd_add_device(struct device *parent, int id,

pdev->dev.parent = parent;

if (cell->pdata_size) {
ret = platform_device_add_data(pdev,
cell->platform_data, cell->pdata_size);
if (ret)
goto fail_res;
}

ret = mfd_platform_add_cell(pdev, cell);
if (ret)
goto fail_res;
Expand Down
4 changes: 4 additions & 0 deletions include/linux/mfd/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ struct mfd_cell {
/* mfd_data can be used to pass data to client drivers */
void *mfd_data;

/* platform data passed to the sub devices drivers */
void *platform_data;
size_t pdata_size;

/*
* These resources can be specified relative to the parent device.
* For accessing hardware you should use resources from the platform dev
Expand Down

0 comments on commit eb89560

Please sign in to comment.