From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/2] video: s3c-fb: Convert to devm style allocation
Date: Tue, 06 Dec 2011 14:37:16 +0000 [thread overview]
Message-ID: <20111206143715.GH17731@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1322434268-25525-2-git-send-email-broonie@opensource.wolfsonmicro.com>
On Tue, Dec 06, 2011 at 09:04:43PM +0900, Kukjin Kim wrote:
> > - sfb->regs = ioremap(res->start, resource_size(res));
> > + sfb->regs = devm_request_and_ioremap(dev, res);
> > if (!sfb->regs) {
> > dev_err(dev, "failed to map registers\n");
> Don't we need dev_err here because the devm_request_and_ioremap() includes
> dev_err() for each error case?
Oh, if it already logs we can just drop that. I was just doing the
transformation based on the API, I didn't actually look at the
implementation.
> And don't we need devm_release_mem_region() or devm_iounmap() in error
> handling?
My expectation was that this was only if you needed to release at
runtime, if the driver fails to bind then devm_ ought to clean up after
you otherwise there's little win from using it. Unless there's a reason
I can't think of right now I'd expect that if we need those we should
fix the core rather than the driver.
> > err_sfb:
> > - kfree(sfb);
> Maybe we need devm_kfree here?
Similarly here, I'd expect us to only need that if we need to free at
runtime for some reason.
prev parent reply other threads:[~2011-12-06 14:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-27 22:51 [PATCH 2/2] video: s3c-fb: Convert to devm style allocation Mark Brown
2011-11-28 7:59 ` Jingoo Han
2011-11-28 11:41 ` Mark Brown
2011-12-06 12:04 ` Kukjin Kim
2011-12-06 14:37 ` Mark Brown [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=20111206143715.GH17731@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-fbdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.