Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755326Ab0BIRNg (ORCPT ); Tue, 9 Feb 2010 12:13:36 -0500 Received: from mail-iw0-f171.google.com ([209.85.223.171]:42094 "EHLO mail-iw0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754761Ab0BIRNe convert rfc822-to-8bit (ORCPT ); Tue, 9 Feb 2010 12:13:34 -0500 MIME-Version: 1.0 In-Reply-To: <20100205203236.GC1475@oksana.dev.rtsoft.ru> References: <20100205203201.GA32281@oksana.dev.rtsoft.ru> <20100205203236.GC1475@oksana.dev.rtsoft.ru> From: Grant Likely Date: Tue, 9 Feb 2010 10:13:11 -0700 X-Google-Sender-Auth: c2fdce183ff1a73a Message-ID: Subject: Re: [PATCH 3/4] of/gpio: Implement GPIOLIB notifier hooks To: Anton Vorontsov Cc: David Brownell , Andrew Morton , Bill Gatliff , Dmitry Eremin-Solenikov , Benjamin Herrenschmidt , linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 33 On Fri, Feb 5, 2010 at 1:32 PM, Anton Vorontsov wrote: > This patch implements GPIOLIB notifier hooks, and thus makes device-enabled > GPIO chips (i.e. the ones that have gpio_chip->dev specified) automatically > attached to the OpenFirmware subsystem. Which means that now we can handle > I2C and SPI GPIO chips almost* transparently. > > * "Almost" because some chips still require platform data, and for these > ?chips OF-glue is still needed, though with this support the glue will > ?be much smaller. > > Signed-off-by: Anton Vorontsov > --- > +static struct notifier_block of_gpio_nb = { > + ? ? ? .notifier_call = of_gpio_notify, > +}; > + > +static int __init of_gpio_notifier_init(void) > +{ > + ? ? ? return blocking_notifier_chain_register(&gpio_notifier, &of_gpio_nb); > +} > +arch_initcall(of_gpio_notifier_init); Another concern; if any gpio chips get registered before this arch_initcall (not sure if it is possible or not), then those chips won't get registered with the of gpio infrastructure. g. -- 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/