1 From cc1b0765da6078b906772b79ff211b88cc0ae958 Mon Sep 17 00:00:00 2001
2 From: sricharan <r.sricharan@ti.com>
3 Date: Wed, 23 Nov 2011 14:35:07 -0800
4 Subject: ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs
6 From: sricharan <r.sricharan@ti.com>
8 commit cc1b0765da6078b906772b79ff211b88cc0ae958 upstream.
10 The address spaces, irqs and dma reqs count APIs return the
11 number of corresponding entries in a hwmod including a additional
12 null value or a -1 terminator in the structure introduced recently.
13 More information here:
15 - 212738a4: omap_hwmod: use a terminator record with omap_hwmod_mpu_irqs
18 - 78183f3f: omap_hwmod: use a null structure record to terminate
19 omap_hwmod_addr_space arrays
21 - bc614958: omap_hwmod: use a terminator record with omap_hwmod_dma_info
24 The issue with irqs and dma info was originally reported by Benoit Cousson.
26 The devices which have multiple hwmods and use device_build_ss are
27 broken with this, as their resources are populated with a extra null
28 value, subsequently the probe fails. So fix the API not to include
29 the array terminator in the count.
31 Reported-by: Benoit Cousson <b-cousson@ti.com>
32 Signed-off-by: Santosh Shilimkar <santosh.shilimar@ti.com>
33 Signed-off-by: sricharan <r.sricharan@ti.com>
34 Signed-off-by: Benoit Cousson <b-cousson@ti.com>
35 Cc: Paul Walmsley <paul@pwsan.com>
36 Signed-off-by: Tony Lindgren <tony@atomide.com>
37 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
40 arch/arm/mach-omap2/omap_hwmod.c | 6 +++---
41 1 file changed, 3 insertions(+), 3 deletions(-)
43 --- a/arch/arm/mach-omap2/omap_hwmod.c
44 +++ b/arch/arm/mach-omap2/omap_hwmod.c
45 @@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_h
46 ohii = &oh->mpu_irqs[i++];
47 } while (ohii->irq != -1);
54 @@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_
55 ohdi = &oh->sdma_reqs[i++];
56 } while (ohdi->dma_req != -1);
63 @@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(str
65 } while (mem->pa_start != mem->pa_end);