Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-14 Thread Benjamin Herrenschmidt
On Fri, 2018-06-15 at 08:16 +0200, Geert Uytterhoeven wrote: > Hi Ben, > > On Fri, Jun 15, 2018 at 1:51 AM Benjamin Herrenschmidt > wrote: > > On Thu, 2018-06-14 at 10:27 +0200, Geert Uytterhoeven wrote: > > > > --- a/include/linux/of_address.h > > > > +++ b/include/linux/of_address.h > > > > @@

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-14 Thread Geert Uytterhoeven
Hi Ben, On Fri, Jun 15, 2018 at 1:51 AM Benjamin Herrenschmidt wrote: > On Thu, 2018-06-14 at 10:27 +0200, Geert Uytterhoeven wrote: > > > --- a/include/linux/of_address.h > > > +++ b/include/linux/of_address.h > > > @@ -40,6 +40,11 @@ extern void __iomem *of_iomap(struct device_node > > > *devi

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-14 Thread Benjamin Herrenschmidt
On Thu, 2018-06-14 at 10:27 +0200, Geert Uytterhoeven wrote: > > --- a/include/linux/of_address.h > > +++ b/include/linux/of_address.h > > @@ -40,6 +40,11 @@ extern void __iomem *of_iomap(struct device_node > > *device, int index); > > void __iomem *of_io_request_and_map(struct device_node *devi

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-14 Thread kbuild test robot
Hi Benjamin, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.17 next-20180614] [cannot apply to glikely/devicetree/next] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-14 Thread Geert Uytterhoeven
Hi Ben, (the "m68k" later in the thread caught my attention ;-) On Tue, Jun 12, 2018 at 2:02 AM Benjamin Herrenschmidt wrote: > There are still quite a few cases where a device might want to get to a > different node of the device-tree, obtain the resources and map them. > > Drivers doing that c

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-13 Thread Benjamin Herrenschmidt
On Wed, 2018-06-13 at 09:00 -0600, Rob Herring wrote: > > > My thinking was to then replace most of_iomap users with this. > > > > As for the specific case of the driver I'm cooking, it's a case where > > the SoC contains a little coprocessor (a ColdFire even !) alongside the > > Wow. Must be th

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-13 Thread Rob Herring
On Tue, Jun 12, 2018 at 4:53 PM, Benjamin Herrenschmidt wrote: > On Tue, 2018-06-12 at 11:42 -0600, Rob Herring wrote: >> On Mon, Jun 11, 2018 at 6:01 PM, Benjamin Herrenschmidt >> wrote: >> > There are still quite a few cases where a device might want to get to a >> > different node of the devic

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-13 Thread Andy Shevchenko
On Wed, Jun 13, 2018 at 3:18 AM, Benjamin Herrenschmidt wrote: > But there are many other uses of things like of_iomap() which could > benefit from switching to devm_of_iomap() and thus getting the > automated cleanup on exit and appropriate request of the memory > resource. Fine, fine. -- Wit

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Benjamin Herrenschmidt
On Wed, 2018-06-13 at 02:16 +0300, Andy Shevchenko wrote: > On Wed, Jun 13, 2018 at 1:58 AM, Benjamin Herrenschmidt > wrote: > > On Tue, 2018-06-12 at 19:53 +0300, Andy Shevchenko wrote: > > > > > > > > It feels like a wrong approach. > > > > > Can OF graph help here? Would it be better approach?

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Andy Shevchenko
On Wed, Jun 13, 2018 at 1:58 AM, Benjamin Herrenschmidt wrote: > On Tue, 2018-06-12 at 19:53 +0300, Andy Shevchenko wrote: >> >> > > It feels like a wrong approach. >> > > Can OF graph help here? Would it be better approach? >> > >> > I don't quite understand what your objection is nor what "OF gr

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Benjamin Herrenschmidt
On Tue, 2018-06-12 at 19:53 +0300, Andy Shevchenko wrote: > > > > It feels like a wrong approach. > > > Can OF graph help here? Would it be better approach? > > > > I don't quite understand what your objection is nor what "OF graph" > > is... > > There is no objection per se, just a doubt that t

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Benjamin Herrenschmidt
On Tue, 2018-06-12 at 11:42 -0600, Rob Herring wrote: > On Mon, Jun 11, 2018 at 6:01 PM, Benjamin Herrenschmidt > wrote: > > There are still quite a few cases where a device might want to get to a > > different node of the device-tree, obtain the resources and map them. > > > > Drivers doing that

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Rob Herring
On Mon, Jun 11, 2018 at 6:01 PM, Benjamin Herrenschmidt wrote: > There are still quite a few cases where a device might want to get to a > different node of the device-tree, obtain the resources and map them. > > Drivers doing that currently open code the whole thing, which is error > proe. > > We

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Andy Shevchenko
On Tue, Jun 12, 2018 at 1:28 PM, Benjamin Herrenschmidt wrote: > On Tue, 2018-06-12 at 11:35 +0300, Andy Shevchenko wrote: >> On Tue, Jun 12, 2018 at 3:01 AM, Benjamin Herrenschmidt >> wrote: >> > There are still quite a few cases where a device might want to get to a >> > different node of the d

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Benjamin Herrenschmidt
On Tue, 2018-06-12 at 11:35 +0300, Andy Shevchenko wrote: > On Tue, Jun 12, 2018 at 3:01 AM, Benjamin Herrenschmidt > wrote: > > There are still quite a few cases where a device might want to get to a > > different node of the device-tree, obtain the resources and map them. > > > > Drivers doing

Re: [PATCH] drivers/of: Add devm_of_iomap()

2018-06-12 Thread Andy Shevchenko
On Tue, Jun 12, 2018 at 3:01 AM, Benjamin Herrenschmidt wrote: > There are still quite a few cases where a device might want to get to a > different node of the device-tree, obtain the resources and map them. > > Drivers doing that currently open code the whole thing, which is error > proe. prone