From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mika Westerberg Subject: Re: [RFC PATCH v2 07/16] gpio: Add support for unified device properties interface Date: Wed, 24 Sep 2014 12:38:23 +0300 Message-ID: <20140924093823.GW1786@lahna.fi.intel.com> References: <1410868367-11056-1-git-send-email-mika.westerberg@linux.intel.com> <2809308.3y5s7TV5Ip@wuerfel> <6744174.JquHLt80n3@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <6744174.JquHLt80n3@wuerfel> Sender: linux-acpi-owner@vger.kernel.org To: Arnd Bergmann Cc: Darren Hart , "Rafael J. Wysocki" , David Woodhouse , Linus Walleij , Grant Likely , Mark Rutland , ACPI Devel Maling List , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Alexandre Courbot , Dmitry Torokhov , Bryan Wu , Lee Jones , Aaron Lu List-Id: devicetree@vger.kernel.org On Wed, Sep 24, 2014 at 11:12:36AM +0200, Arnd Bergmann wrote: > As a start, we could probably take the proposed device_for_each_child_node > and move that into the leds-core, changing the fw_dev_node argument > for an led_classdev with the addition of the of_node and acpi_object > members. It would still leave it up to the gpio-leds driver to do > > if (led_cdev->of_node) > gpiod = devm_of_get_gpiod(led_cdev->of_node, ...); > else > gpiod = devm_acpi_get_gpiod(led_cdev->acpi_object, ...); > > but there seems little benefit in abstracting this because there is > only one driver that needs it. The same interface is used also in gpio_keys_polled.c driver so if we want to avoid duplicating code this needs to be abstracted away from the drivers.