aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorsricharan <r.sricharan@xxxxxx>2011-11-11 18:08:35 +0800
committerAndy Green <andy.green@linaro.org>2011-11-19 08:54:57 +0800
commite07172c431bff3addce4437643c33b221a22022e (patch)
treef408908475d43adea9e2d013976b3da4c96d4420 /arch/arm
parentf0a7faa144560c43956baf794a6a3259a4c95c48 (diff)
OMAP: hwmod: Fix the addr space, irq, dma count APIs
The address spaces, irqs and dma reqs count API returns the number of corresponding entries in a hwmod including a additional null value or a -1 terminator in the structure introduced recently. More information here: - 212738a4 (omap_hwmod: use a terminator record with omap_hwmod_mpu_irqs arrays) - 78183f3f (omap_hwmod: use a null structure record to terminate omap_hwmod_addr_space arrays) - bc614958 (omap_hwmod: use a terminator record with omap_hwmod_dma_info arrays) The issue with irqs and dma info was originally reported by Benoit Cousson. The devices which have multiple hwmods and use device_build_ss are broken with this, as their resources are populated with a extra null value, subsequently the probe fails. So fix the API not to include the array terminator in the count. Reported-by: Benoit Cousson <b-cousson@xxxxxx> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@xxxxxx> Signed-off-by: sricharan <r.sricharan@xxxxxx> Acked: Benoit Cousson <b-cousson@xxxxxx> Signed-off-by: Sebastien Jan <s-jan@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index f70e3c76f0f..d25a78f2a4f 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_hwmod *oh)
ohii = &oh->mpu_irqs[i++];
} while (ohii->irq != -1);
- return i;
+ return i-1;
}
/**
@@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_hwmod *oh)
ohdi = &oh->sdma_reqs[i++];
} while (ohdi->dma_req != -1);
- return i;
+ return i-1;
}
/**
@@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
mem = &os->addr[i++];
} while (mem->pa_start != mem->pa_end);
- return i;
+ return i-1;
}
/**