devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* of_iomap() and devres questions
@ 2013-04-02 19:25 Markus Mayer
       [not found] ` <515B30C7.6040002-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Mayer @ 2013-04-02 19:25 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

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?

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()?

Thanks,
-Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: of_iomap() and devres questions
       [not found] ` <515B30C7.6040002-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2013-04-03 18:39   ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2013-04-03 18:39 UTC (permalink / raw)
  To: Markus Mayer; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-03 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).