[PATCH v2 1/3] i2c: s3c2410: Keep a copy of platform data and use it.

Thomas Abraham thomas.abraham at linaro.org
Mon Aug 1 06:33:58 EST 2011


Hi Grant,

On 31 July 2011 04:51, Grant Likely <grant.likely at secretlab.ca> wrote:
> On Fri, Jul 22, 2011 at 03:48:36PM +0530, Thomas Abraham wrote:
>> The platform data is copied into driver's private data and the copy is
>> used for all access to the platform data. This simpifies the addition
>> of device tree support for the i2c-s3c2410 driver.
>>
>> Signed-off-by: Thomas Abraham <thomas.abraham at linaro.org>
>> ---
>>  drivers/i2c/busses/i2c-s3c2410.c |    7 +++++--
>>  1 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
>> index 6c00c10..e132168 100644
>> --- a/drivers/i2c/busses/i2c-s3c2410.c
>> +++ b/drivers/i2c/busses/i2c-s3c2410.c
>> @@ -78,6 +78,7 @@ struct s3c24xx_i2c {
>>       struct resource         *ioarea;
>>       struct i2c_adapter      adap;
>>
>> +     struct s3c2410_platform_i2c     pdata;
>
> After looking at a bunch of patches, there is another way do do this
> I think.  Instead of copying pdata into the private data structure, it
> can remain as a pointer if the DT code uses devm_kzmalloc to allocate
> a s3c2410_platform_i2c structure when needed.
>
> I leave it up to you (and Ben) though as to which you prefer.  I'm
> okay either way, and you can add:

I will submit another patch with the changes you have suggested. Ben
could then choose the approach that he feels is the best.

>
> Acked-by: Grant Likely <grant.likely at secretlab.ca>

Thanks Grant.


Regards,
Thomas.

>
>
[...]


More information about the devicetree-discuss mailing list