Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbbFETgr (ORCPT ); Fri, 5 Jun 2015 15:36:47 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:33428 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbbFETgp (ORCPT ); Fri, 5 Jun 2015 15:36:45 -0400 Date: Fri, 5 Jun 2015 21:36:31 +0200 From: Rabin Vincent To: Linus Walleij Cc: Alexandre Courbot , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] gpio: add ETRAXFS GPIO driver Message-ID: <20150605193631.GA28794@debian> References: <1431728843-21583-1-git-send-email-rabin@rab.in> <20150521184855.GA6159@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 28 On Mon, Jun 01, 2015 at 03:45:35PM +0200, Linus Walleij wrote: > There is also the code such as of_gpio_simple_xlate() > that can't be reused for this, so thus it needs its own xlate > function and adds some complexity to the code. > But the convention in of_gpio_simple_xlate() is that > cell 0 is offset, and cell 1 is flags, so what about > moving the bank number to the last argument so you > can still use of_gpio_simple_xlate()? > > Like so: > gpios = <&gio 5 0 0xD>, <&gio 6 0 0xD>; > > I.e. extra cells go at the end. I can see you have a check > hack to see it is hitting a valid GPIO chip by using the label, > but that doesn't seem totally necessary. That code is quite necessary, because that is what makes us bind to the correct gpio chip. The wrong gpio chips' xlate() return an error code and the code in of_gpiochip_find_and_xlate() makes sure we look through the rest of the chips in the OF node until we find the right one. But the xlate function can change the order as you suggest and use of_gpio_simple_xlate() as a helper. I'll make it do that. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/