From: Chris Ball <cjb@laptop.org>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] mmc: slot-gpio: use devm_* managed functions to ease users
Date: Mon, 10 Dec 2012 20:58:09 -0500 [thread overview]
Message-ID: <87d2yh4afi.fsf@octavius.laptop.org> (raw)
In-Reply-To: <20121207144006.GB30468@S2100-06.ap.freescale.net> (Shawn Guo's message of "Fri, 7 Dec 2012 22:40:10 +0800")
Hi Shawn, Guennadi,
On Fri, Dec 07 2012, Shawn Guo wrote:
>> > Use devm_* managed functions, so that slot-gpio users do not have to
>> > call mmc_gpio_free_ro/cd to free up resources requested in
>> > mmc_gpio_request_ro/cd.
>> >
>> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>>
>> Thanks for the patch, but I'm not sure this is a good idea. Firstly, using
>> devm_* allocation functions means, that normally you don't have to free
>> these resources explicitly any more. So, actually you would have to remove
>> free_irq() and gpio_free() calls completely from the API instead of
>> replacing them with devm_* analogs.
>
> With the changes, most of the slot-gpio users will only need to call
> mmc_gpio_request_* functions at probe time, nothing else. That said,
> they will not call mmc_gpio_free_* functions at all. I patched
> mmc_gpio_free_* functions replacing free_irq() and gpio_free() with
> devm_* versions to 1) ease the migration of exiting users calling
> mmc_gpio_free_*; 2) provide a mean for users to manually free resources
> for whatever reasons.
I'd like to find a way to merge this -- maybe we can compromise by
adding a comment or some documentation that explains that you need to be
careful (and use _request_* and _free_*) to avoid allocating more than
once if you're doing something odd like runtime switching between CD
methods?
Thanks!
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2012-12-11 1:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 13:32 [PATCH 1/2] mmc: slot-gpio: use devm_* managed functions to ease users Shawn Guo
2012-12-07 13:32 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: use slot-gpio helpers for CD and WP Shawn Guo
2012-12-07 13:49 ` [PATCH 1/2] mmc: slot-gpio: use devm_* managed functions to ease users Guennadi Liakhovetski
2012-12-07 14:40 ` Shawn Guo
2012-12-11 1:58 ` Chris Ball [this message]
2012-12-11 7:32 ` Guennadi Liakhovetski
2012-12-11 12:55 ` Shawn Guo
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=87d2yh4afi.fsf@octavius.laptop.org \
--to=cjb@laptop.org \
--cc=g.liakhovetski@gmx.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.guo@linaro.org \
/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