On Sunday 22 February 2009, Stijn Devriendt wrote:
> +static const struct gpio_led_platform_data evm_led_data = {
Make this "__initconst" ...
> + .num_leds = ARRAY_SIZE(evm_leds),
> + .leds = evm_leds,
> +};
> +
> +static struct platform_device *evm_led_dev;
> +
> +static int evm_led_setup(struct i2c_client *client, int gpio,
> unsigned int ngpio, void *c)
> +{
> + struct gpio_led *leds = evm_leds;
> + int status;
> +
> + while (ngpio--) {
> + leds->gpio = gpio++;
> + leds++;
> + };
> +
> + evm_led_dev = platform_device_alloc("leds-gpio", 0);
> + platform_device_add_data(evm_led_dev, &evm_led_data,
> sizeof(evm_led_data));
.... since there's no point in keeping two copies of it
around (add_data makes a copy).
Also, for the switch settings you might consider using
the gpio_export() call. That didn't exist when the
dm6446evm switch code was written.
Other than that, it looks pretty normal.
- Dave
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source