]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Fix checking for multiple boot tags in board config
authorJonathan McDowell <noodles@earth.li>
Mon, 15 May 2006 09:43:49 +0000 (02:43 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 15 May 2006 09:43:49 +0000 (02:43 -0700)
Currently if we look for more than one instance of a boot tag and it's
defined in the board config rather than passed by the boot loader we can
get stuck in a loop where the same tag is processed many times. This can
be seen with the gpio-switch driver, for example. The patch below fixes
this by respecting the skip parameter to get_config when we're scanning
the board config structure.

Signed-Off-By: Jonathan McDowell <noodles@earth.li>
arch/arm/plat-omap/common.c

index 0625df51dced280acbd43c964019de2883f50282..39ab667368ca8d88b4ae4c89029beb2a5b93d262 100644 (file)
@@ -114,8 +114,12 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
         * in the kernel. */
        for (i = 0; i < omap_board_config_size; i++) {
                if (omap_board_config[i].tag == tag) {
-                       kinfo = &omap_board_config[i];
-                       break;
+                       if (skip == 0) {
+                               kinfo = &omap_board_config[i];
+                               break;
+                       } else {
+                               skip--;
+                       }
                }
        }
        if (kinfo == NULL)