ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs
authorsricharan <r.sricharan@ti.com>
Wed, 23 Nov 2011 22:35:07 +0000 (14:35 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Dec 2011 16:54:12 +0000 (08:54 -0800)
commit969b42a8899f173a232b5ad14b2a0f5913c8b3b1
tree074fef72800cf9e73445a68dc74fe00cc2656b8c
parent8fe9f659b730ca92367370cf7ae6de6ef640cf62
ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs

commit cc1b0765da6078b906772b79ff211b88cc0ae958 upstream.

The address spaces, irqs and dma reqs count APIs return 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@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimar@ti.com>
Signed-off-by: sricharan <r.sricharan@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/mach-omap2/omap_hwmod.c