lkml.org 
[lkml]   [2008]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] leds: implement OpenFirmare GPIO LED driver
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));
}


\
 
 \ /
  Last update: 2008-07-17 01:23    [W:0.120 / U:2.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site