Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933879AbZJMSG2 (ORCPT ); Tue, 13 Oct 2009 14:06:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760600AbZJMSG1 (ORCPT ); Tue, 13 Oct 2009 14:06:27 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:58328 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753362AbZJMSG0 (ORCPT ); Tue, 13 Oct 2009 14:06:26 -0400 Date: Tue, 13 Oct 2009 11:05:07 -0700 From: Andrew Morton To: Jonathan Corbet Cc: LKML , David Brownell Subject: Re: [PATCH] GPIO: Add gpio_lookup Message-Id: <20091013110507.a576310a.akpm@linux-foundation.org> In-Reply-To: <20091010134814.0bac8624@bike.lwn.net> References: <20091010134814.0bac8624@bike.lwn.net> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 781 Lines: 27 On Sat, 10 Oct 2009 13:48:14 -0600 Jonathan Corbet wrote: > +int gpio_lookup(const char *name) > +{ > + int i; > + > + for (i = 0; i < ARCH_NR_GPIOS; i++) { > + struct gpio_chip *chip = gpio_desc[i].chip; > + > + if (chip == NULL || chip->names == NULL) > + continue; > + if (!strcmp (name, chip->names[i - chip->base])) { > + printk(KERN_NOTICE "grbn found %d\n", i); > + return i; > + } > + } > + return -EINVAL; > +} > +EXPORT_SYMBOL_GPL(gpio_lookup); I'll assume the printk wasn't supposed to be there. -- 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/