Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+11
+7
drivers/mfd/mfd-core.c
··· 88 88 89 89 pdev->dev.parent = parent; 90 90 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 + 91 98 ret = mfd_platform_add_cell(pdev, cell); 92 99 if (ret) 93 100 goto fail_res;
+4
include/linux/mfd/core.h
··· 36 36 /* mfd_data can be used to pass data to client drivers */ 37 37 void *mfd_data; 38 38 39 + /* platform data passed to the sub devices drivers */ 40 + void *platform_data; 41 + size_t pdata_size; 42 + 39 43 /* 40 44 * These resources can be specified relative to the parent device. 41 45 * For accessing hardware you should use resources from the platform dev