linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Barry Song <21cnbao@gmail.com>, Barry Song <Barry.Song@csr.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, workgroup.linux@csr.com,
	Erik Gilling <konkers@google.com>,
	linux-mtd@lists.infradead.org, Barry Song <Baohua.Song@csr.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH 1/3] platform: add common resource requesting and mapping helper
Date: Tue, 31 Jan 2012 22:15:54 +0100	[thread overview]
Message-ID: <20120131211554.GA28105@pengutronix.de> (raw)
In-Reply-To: <20120131203455.GG22611@ponder.secretlab.ca>

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]


> > I am not sure using 'platform_devm_request_and_ioremap' and later using
> > plain 'devm_*' functions (without platform_-prefix) is less confusing.
> > The alternative would be to check which helper functions also use
> > 'struct resource' and if they do checks on that. If all do that, you
> > would have the simple rule, that you only need to check yourself if you
> > access it yourself.
> 
> The reason I suggested the wrapper is that then the driver code doesn't need
> to fart around with the res pointer at all.  It reduces boilerplate in platform
> drivers which I think is a good thing.

I do understand your motivation and fully agree with what you are aiming for
(that's exactly why I implemented devm_request_and_ioremap()).

This patch is a micro-optimization, though, and won't cut it IMHO. I still have
issues with only one platform_devm_* and all the rest being devm_* (without
platform_). Things might look better, if we'd for example also have
platform_devm_request_irq() or something similar. That might be an approach
where we can play around with and see what is left to do. Or, if other
approaches might be more elegant.

To discuss that, try things, etc, I'd simply like to have a bit more time. If
we are accepting the first iteration right away, and people let run their
coccinelle-scripts based on that, it might get annoying to change that a second
time, I'd think.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-01-31 21:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31  9:59 [PATCH 0/3] platform: add platform_devm_request_and_ioremap() common API Barry Song
2012-01-31 10:00 ` [PATCH 1/3] platform: add common resource requesting and mapping helper Barry Song
2012-01-31 10:17   ` Wolfram Sang
2012-01-31 11:04     ` Barry Song
2012-01-31 11:33       ` Wolfram Sang
2012-01-31 12:09         ` Barry Song
2012-01-31 20:34         ` Grant Likely
2012-01-31 21:15           ` Wolfram Sang [this message]
2012-01-31 21:51             ` Grant Likely
2012-02-01  2:11             ` Barry Song
2012-02-01 10:03               ` Wolfram Sang
2012-02-01 10:20                 ` Barry Song
2012-02-01 12:56               ` Mark Brown
2012-02-02  0:10                 ` Grant Likely
2012-01-31 20:35   ` Grant Likely
2012-01-31 21:20   ` Linus Walleij
2012-01-31 21:52     ` Grant Likely
2012-02-01  2:22     ` Barry Song
2012-01-31 10:00 ` [PATCH 2/3] GPIO: TEGRA: move to use platform_devm_request_and_ioremap() helper Barry Song
2012-01-31 16:55   ` Stephen Warren
2012-01-31 20:37   ` Grant Likely
2012-01-31 10:00 ` [PATCH 3/3] MTD: NAND: txx9ndfmc: " Barry Song
2012-01-31 11:14 ` [PATCH 0/3] platform: add platform_devm_request_and_ioremap() common API Artem Bityutskiy
2012-01-31 12:57   ` Barry Song
2012-01-31 13:16     ` Artem Bityutskiy
2012-01-31 13:23       ` Artem Bityutskiy
2012-01-31 13:27         ` Wolfram Sang

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=20120131211554.GA28105@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=21cnbao@gmail.com \
    --cc=Baohua.Song@csr.com \
    --cc=Barry.Song@csr.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=dwmw2@infradead.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@suse.de \
    --cc=konkers@google.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=workgroup.linux@csr.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;
as well as URLs for NNTP newsgroup(s).