From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: How to handle named resources with DT? Date: Fri, 26 Aug 2011 17:41:29 +0200 Message-ID: <201108261741.29850.arnd@arndb.de> References: <20110809205723.GE11568@ponder.secretlab.ca> <20110826130644.GN2308@yookeroo.fritz.box> <201108261735.55412.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201108261735.55412.arnd-r2nGTMty4D4@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: David Gibson Cc: Kevin Hilman , Paul Walmsley , Russell King - ARM Linux , "G, Manjunath Kondaiah" , "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org" , Felipe Balbi , Scott Wood , linux-omap , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: linux-omap@vger.kernel.org On Friday 26 August 2011, Arnd Bergmann wrote: > On Friday 26 August 2011, David Gibson wrote: > > If you open code it this way then yes, it's silly. But what about > > something like this: > > > > static struct of_device_id foodevice_of_match[] __devinitdata = { > > { .compatible = "foocorp,foodevice1234", > > .resource_names = {"base_regs", "extra_regs", }, }, > > { .compatible = "foocorp,foodevice1239", > > .resource_names = {"base_regs", "extra_regs", "more_regs", }, }, > > { }, > > }; > > Hmm, I hadn't thought of that. This looks quite nice indeed. No objections > to this from my side. > Ah well, one objection on second thought: This assumes that there is just one type of resource, but named resources may be used for iomem, ioport and irq resources. If you have multiple IRQs and multiple IOMEM resources, I don't see how the index in the resource_names array can be used for both of them. Arnd