
Dear Javier Martinez Canillas,
In message 1356349896-11693-1-git-send-email-javier.martinez@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.martinez@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