From: Grant Likely <grant.likely@secretlab.ca>
To: Daniel Mack <zonque@gmail.com>
Cc: Balaji T K <balajitk@ti.com>,
linux-mmc@vger.kernel.org, Venkatraman S <svenkatr@ti.com>,
Chris Ball <cjb@laptop.org>,
Rob Herring <rob.herring@calxeda.com>,
linux-omap@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] MMC: omap_hsmmc: set platform data after probe from DT node
Date: Sat, 13 Oct 2012 13:37:20 +0100 [thread overview]
Message-ID: <1c7b8951-3bf2-4433-8c6a-9d70ef47b3c4@email.android.com> (raw)
In-Reply-To: <50792BF7.5020908@gmail.com>
Daniel Mack <zonque@gmail.com> 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.
prev parent reply other threads:[~2012-10-13 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1350039495-360-1-git-send-email-zonque@gmail.com>
[not found] ` <1350039495-360-2-git-send-email-zonque@gmail.com>
[not found] ` <5078295E.2090803@gmail.com>
[not found] ` <50782F82.8060206@ti.com>
[not found] ` <507833ED.8060903@gmail.com>
[not found] ` <507835E9.9020200@ti.com>
[not found] ` <ae718323-6d65-4e69-b8f9-6382c6299294@email.android.com>
[not found] ` <507920E0.2050104@gmail.com>
2012-10-13 8:48 ` Grant Likely
2012-10-13 8:53 ` Daniel Mack
2012-10-13 12:37 ` Grant Likely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c7b8951-3bf2-4433-8c6a-9d70ef47b3c4@email.android.com \
--to=grant.likely@secretlab.ca \
--cc=balajitk@ti.com \
--cc=cjb@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=svenkatr@ti.com \
--cc=zonque@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®