Re: [PATCH 1/4] leds: Support OpenFirmware led bindings
From: Trent Piepho
Date: Thu Dec 11 2008 - 16:35:12 EST
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/