Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758627AbYGPXUR (ORCPT ); Wed, 16 Jul 2008 19:20:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759146AbYGPXUE (ORCPT ); Wed, 16 Jul 2008 19:20:04 -0400 Received: from az33egw01.freescale.net ([192.88.158.102]:48212 "EHLO az33egw01.freescale.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759174AbYGPXUD (ORCPT ); Wed, 16 Jul 2008 19:20:03 -0400 Date: Wed, 16 Jul 2008 16:18:52 -0700 (PDT) From: Trent Piepho X-X-Sender: xyzzy@t2.domain.actdsltmp To: Anton Vorontsov cc: Richard Purdie , Stephen Rothwell , Kumar Gala , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org Subject: Re: [PATCH v3] leds: implement OpenFirmare GPIO LED driver In-Reply-To: <20080715151917.GA30607@polina.dev.rtsoft.ru> Message-ID: References: <1216133032.5345.73.camel@dax.rpnet.com> <20080715151917.GA30607@polina.dev.rtsoft.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 846 Lines: 26 On Tue, 15 Jul 2008, Anton Vorontsov wrote: > Despite leds-gpio and leds-openfirmware-gpio similar purposes, there > is not much code can be shared between the two drivers (both are mostly > driver bindings anyway). Why can't this driver use the existing gpio-led driver? Basically, do something like this: of_gpio_leds_probe(...) { gpio = of_get_gpio(np, 0); label = of_get_property(np, "label", NULL); struct gpio_led led = { .name = label, .gpio = gpio, }; pdev = platform_device_register_simple("leds-gpio", 0, NULL, 0); platform_device_add_data(pdev, &led, sizeof(led)); } -- 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/