Dear Javier Martinez Canillas,

In message <1356349896-11693-1-git-send-email-javier.marti...@collabora.co.uk> 
you wrote:
> This patch adds an GPIO LED boot status for IGEP boards.
> 
> The GPIO LED used is the red LED0 while the Linux kernel
> uses the green LED0 as the boot status.
> 
> By using different GPIO LEDs, the user can know in which
> step of the boot process the board currently is.
> 
> Signed-off-by: Javier Martinez Canillas <javier.marti...@collabora.co.uk>
...
> --- a/board/isee/igep0020/igep0020.c
> +++ b/board/isee/igep0020/igep0020.c
...
> +#if defined(CONFIG_SHOW_BOOT_PROGRESS) && !defined(CONFIG_SPL_BUILD)
> +void show_boot_progress(int val)
> +{
> +     if (val < 0) {
> +             /* something went wrong */
> +             return;
> +     }
> +
> +     if (!gpio_request(IGEP0020_GPIO_LED, "")) {
> +             gpio_direction_output(IGEP0020_GPIO_LED, 0);
> +             gpio_set_value(IGEP0020_GPIO_LED, 1);
> +     }
> +}
> +#endif
...
> --- a/board/isee/igep0030/igep0030.c
> +++ b/board/isee/igep0030/igep0030.c
...
> +#if defined(CONFIG_SHOW_BOOT_PROGRESS) && !defined(CONFIG_SPL_BUILD)
> +void show_boot_progress(int val)
> +{
> +     if (val < 0) {
> +             /* something went wrong */
> +             return;
> +     }
> +
> +     if (!gpio_request(IGEP0030_GPIO_LED, "")) {
> +             gpio_direction_output(IGEP0030_GPIO_LED, 0);
> +             gpio_set_value(IGEP0030_GPIO_LED, 1);
> +     }
> +}
> +#endif

Can we not avoid duplicating this code?   If you change
IGEP0020_GPIO_LED and IGEP0030_GPIO_LED into some common name like
IGEP00XX_GPIO_LED, you can use common code for all such boards.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Whenever people agree with me, I always think I must be wrong.
- Oscar Wilde
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to