devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Markus Mayer <mmayer-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: of_iomap() and devres questions
Date: Wed, 03 Apr 2013 13:39:20 -0500	[thread overview]
Message-ID: <515C7758.8010807@gmail.com> (raw)
In-Reply-To: <515B30C7.6040002-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

On 04/02/2013 02:25 PM, Markus Mayer wrote:
> Hi all,
> 
> I have a few questions regarding the implementation of the of_iomap()
> function.
> 
> As it currently stands, the function parses the device tree for the
> device's address and then simply calls ioremap() with that address and
> the associated size.
> 
> The first question that has come up is why of_iomap() doesn't also call
> request_mem_region()? Is there a particular reason for it or has it just
> not yet been implemented?

Don't know. It probably should not and make cause some breakage.

> The second question is regarding the use of devres in of_iomap(). Would
> it make sense for of_iomap() to use devm_ioremap() or, better yet,
> devm_request_and_ioremap() instead of simply calling ioremap()?

You should not be using of_iomap in a driver, but rather the functions
you mention. of_iomap is mainly used in cases where there is no driver
or struct device. Which means devm_* functions would be pointless. Also
there is no way to get from a struct device_node ptr to a struct device ptr.

Rob

> 
> Thanks,
> -Markus
> 
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

      parent reply	other threads:[~2013-04-03 18:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02 19:25 of_iomap() and devres questions Markus Mayer
     [not found] ` <515B30C7.6040002-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-04-03 18:39   ` Rob Herring [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=515C7758.8010807@gmail.com \
    --to=robherring2-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=mmayer-dY08KVG/lbpWk0Htik3J/w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).