lkml.org 
[lkml]   [2008]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] leds: Support OpenFirmware led bindings
On Wed, 10 Dec 2008, Anton Vorontsov wrote:
>> + gpio_direction_output(led_dat->gpio, led_dat->active_low);
>
> This can fail (yeah, the original code didn't check return value
> either).

I've added a check.

>> + unsigned int flags;
>
> I think it would be better to use `enum of_gpio_flags' type here,
> just for clarity.

You're right, I forgot to change this after the of_get_gpio patch was
changed.

>> + ret = create_gpio_led(&led, &pdata->led_data[pdata->num_leds++],
>> + &ofdev->dev, NULL);
>> + if (ret < 0)
>
> of_node_put(np); is missing here.

of_node_put(child) you mean. It's easy to forget this when one exits one
of these iterators early, since there's no explicit get or put otherwise.


\
 
 \ /
  Last update: 2008-12-11 22:37    [W:0.060 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site