Re: [PATCH 15/19] mc13xxx: mfd_cell is now implicitly available to drivers

Hello Andres,

On Wed, Feb 02, 2011 at 08:20:15PM -0800, Andres Salomon wrote:> > No need to explicitly set the cell's platform_data/data_size.> > In this case, move the various platform_data pointers> to driver_data. All of the clients which make use of it> are also changed.> > Mfd-core makes a copy of platform_data, but driver_data keeps a pointer> to the original data. Because each cell's platform_data previously> pointed to a local (stack) variable, the various ARM mach types that set> the pdata are updated to keep the memory around.I didn't get this even after reading it 5 times. You wrote in thesubject that drivers now have access to mfd_cell. I don't see wheree.g. drivers/leds/leds-mc13783.c uses that?! Does this depend on somemfd-changes I don't see and this is just a first step?

After reading the changes I think I understood:

- You made things that were passed as platform_data before available via driver_data. - Because platform_data is copied and driver_data is not at register time, the data being platform_data cannot be __initdata or stack local anymore, so this needs fixing.

In sum this results in .data becoming bigger (which is bad).

And I think this patch has a conceptual problem, too. In my opionionplatform_data is the point to hand over platform specific data to adriver. driver_data is something that is private to the driver and hasto be considered opaque for the platform. The driver was sort of OKbefore ...