aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include/plat/omap_hwmod.h
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2011-07-09 21:14:07 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-09 21:14:07 -0400
commitbc6149587b309e3231e5ac7138b84197813e17ec (patch)
tree0b2b29bce338be46b985ce6d3aaa2bd2671fbaa9 /arch/arm/plat-omap/include/plat/omap_hwmod.h
parent0d619a89998d308c48d06b033eccb7374c456f12 (diff)
omap_hwmod: use a terminator record with omap_hwmod_dma_info arrays
Previously, struct omap_hwmod_dma_info arrays were unterminated; and users of these arrays used the ARRAY_SIZE() macro to determine the length of the array. However, ARRAY_SIZE() only works when the array is in the same scope as the macro user. So far this hasn't been a problem. However, to reduce duplicated data, a subsequent patch will move common data to a separate, shared file. When this is done, ARRAY_SIZE() will no longer be usable. This patch removes ARRAY_SIZE() usage for struct omap_hwmod_dma_info arrays and uses a sentinel value (irq == -1) as the array terminator instead. Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/omap_hwmod.h')
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 3bd6d1d9c0da..822556ea3789 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -112,7 +112,7 @@ struct omap_hwmod_irq_info {
112/** 112/**
113 * struct omap_hwmod_dma_info - DMA channels used by the hwmod 113 * struct omap_hwmod_dma_info - DMA channels used by the hwmod
114 * @name: name of the DMA channel (module local name) 114 * @name: name of the DMA channel (module local name)
115 * @dma_req: DMA request ID 115 * @dma_req: DMA request ID (should be non-negative except -1 = terminator)
116 * 116 *
117 * @name should be something short, e.g., "tx" or "rx". It is for use 117 * @name should be something short, e.g., "tx" or "rx". It is for use
118 * by platform_get_resource_byname(). It is defined locally to the 118 * by platform_get_resource_byname(). It is defined locally to the
@@ -120,7 +120,7 @@ struct omap_hwmod_irq_info {
120 */ 120 */
121struct omap_hwmod_dma_info { 121struct omap_hwmod_dma_info {
122 const char *name; 122 const char *name;
123 u16 dma_req; 123 s16 dma_req;
124}; 124};
125 125
126/** 126/**
@@ -467,7 +467,7 @@ struct omap_hwmod_class {
467 * @class: struct omap_hwmod_class * to the class of this hwmod 467 * @class: struct omap_hwmod_class * to the class of this hwmod
468 * @od: struct omap_device currently associated with this hwmod (internal use) 468 * @od: struct omap_device currently associated with this hwmod (internal use)
469 * @mpu_irqs: ptr to an array of MPU IRQs 469 * @mpu_irqs: ptr to an array of MPU IRQs
470 * @sdma_reqs: ptr to an array of System DMA request IDs (see sdma_reqs_cnt) 470 * @sdma_reqs: ptr to an array of System DMA request IDs
471 * @prcm: PRCM data pertaining to this hwmod 471 * @prcm: PRCM data pertaining to this hwmod
472 * @main_clk: main clock: OMAP clock name 472 * @main_clk: main clock: OMAP clock name
473 * @_clk: pointer to the main struct clk (filled in at runtime) 473 * @_clk: pointer to the main struct clk (filled in at runtime)
@@ -480,7 +480,6 @@ struct omap_hwmod_class {
480 * @_sysc_cache: internal-use hwmod flags 480 * @_sysc_cache: internal-use hwmod flags
481 * @_mpu_rt_va: cached register target start address (internal use) 481 * @_mpu_rt_va: cached register target start address (internal use)
482 * @_mpu_port_index: cached MPU register target slave ID (internal use) 482 * @_mpu_port_index: cached MPU register target slave ID (internal use)
483 * @sdma_reqs_cnt: number of @sdma_reqs
484 * @opt_clks_cnt: number of @opt_clks 483 * @opt_clks_cnt: number of @opt_clks
485 * @master_cnt: number of @master entries 484 * @master_cnt: number of @master entries
486 * @slaves_cnt: number of @slave entries 485 * @slaves_cnt: number of @slave entries
@@ -528,7 +527,6 @@ struct omap_hwmod {
528 u16 flags; 527 u16 flags;
529 u8 _mpu_port_index; 528 u8 _mpu_port_index;
530 u8 response_lat; 529 u8 response_lat;
531 u8 sdma_reqs_cnt;
532 u8 rst_lines_cnt; 530 u8 rst_lines_cnt;
533 u8 opt_clks_cnt; 531 u8 opt_clks_cnt;
534 u8 masters_cnt; 532 u8 masters_cnt;