From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 0F258DDE08 for ; Sun, 23 Dec 2007 13:49:35 +1100 (EST) In-Reply-To: <20071221203115.GA4633@localhost.localdomain> References: <20071221202824.GA4607@localhost.localdomain> <20071221203115.GA4633@localhost.localdomain> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: From: Segher Boessenkool Subject: Re: [PATCH 1/4] [POWERPC] Implement GPIO API embryo Date: Sun, 23 Dec 2007 03:49:30 +0100 To: Anton Vorontsov Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > +int __of_parse_gpio_bank_pin(struct device_node *np, int index, > + int bank_width, int max_bank) > +{ > + int bank; > + int pin; > + const u32 *gpios; > + > + /* > + * We can get there only if of_get_gpio() succeeded, thus > + * no need checking for "gpios" existence. > + */ > + gpios = of_get_property(np, "gpios", NULL); > + bank = gpios[index * 2]; > + pin = gpios[index * 2 + 1]; If you stick with the #gpio-cells plan, here is where you should use it. Segher