Re: [PATCH 1/4] MMC: omap_hsmmc: set platform data after probe from DT node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Daniel Mack <zonque@xxxxxxxxx> wrote:

>On 13.10.2012 10:48, Grant Likely wrote:
>> 
>> somedriver_probe(struct platform_device *pdev)
>> {
>>       struct somedriver_private *somedriver;
>> 
>>       somedriver = devm_kzalloc(sizeof (*somedriver), GFP_KERNEL);
>>       somedriver->pdata = pdev->platform_data;
>>       if (OF)
>>               somedriver->pdata = devm_kzalloc(sizeof
>> (*somedriver->pdata), GFP_KERNEL);
>> }
>> 
>> The bonus with using devm_kzalloc is the driver doesn't even need to
>> do anything special to undo these allocations on failure or release.
>> :-)
>
>Ok, understood. Will keep an eye on this in the future. Thanks again
>for
>the explanation.
>
>For this particular driver, this means that both my and Balaji's ways
>of
>fixing this are wrong?

Balaji's patch looks fine since it uses a local copy of the platform data structure. It appears that the driver is already creating a local copy and Balaji is just bug fixing call sites that aren't using it yet.

g.

-- 
Grant Likely, P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux