diff options
author | Timur Tabi <timur@freescale.com> | 2006-11-09 16:42:44 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-11-12 22:49:01 -0500 |
commit | fc9e8b4e275b6882cb537154c8fc7cde3692eea0 (patch) | |
tree | 6c33e974098943f805e153ed22548652f8c6c0b9 | |
parent | 0613ffbf53625ccecb96500b1cc7b0ef70cc8f04 (diff) |
[PATCH] Optimize qe_brg struct to use an array
The qe_brg structure manually defined each of the 16 BRG registers, which
made any code that used them cumbersome. This patch replaces the fields
with a single 16-element array.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe.c | 3 | ||||
-rw-r--r-- | include/asm-powerpc/immap_qe.h | 17 |
2 files changed, 2 insertions, 18 deletions
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index 2bae632d3ad7..812c87c73bb6 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -175,8 +175,7 @@ void qe_setbrg(u32 brg, u32 rate) | |||
175 | u32 divisor, tempval; | 175 | u32 divisor, tempval; |
176 | int div16 = 0; | 176 | int div16 = 0; |
177 | 177 | ||
178 | bp = &qe_immr->brg.brgc1; | 178 | bp = &qe_immr->brg.brgc[brg]; |
179 | bp += brg; | ||
180 | 179 | ||
181 | divisor = (get_brg_clk() / rate); | 180 | divisor = (get_brg_clk() / rate); |
182 | if (divisor > QE_BRGC_DIVISOR_MAX + 1) { | 181 | if (divisor > QE_BRGC_DIVISOR_MAX + 1) { |
diff --git a/include/asm-powerpc/immap_qe.h b/include/asm-powerpc/immap_qe.h index ce12f85fff9b..9fdd0491f6a3 100644 --- a/include/asm-powerpc/immap_qe.h +++ b/include/asm-powerpc/immap_qe.h | |||
@@ -136,22 +136,7 @@ struct qe_timers { | |||
136 | 136 | ||
137 | /* BRG */ | 137 | /* BRG */ |
138 | struct qe_brg { | 138 | struct qe_brg { |
139 | __be32 brgc1; /* BRG1 configuration register */ | 139 | __be32 brgc[16]; /* BRG configuration registers */ |
140 | __be32 brgc2; /* BRG2 configuration register */ | ||
141 | __be32 brgc3; /* BRG3 configuration register */ | ||
142 | __be32 brgc4; /* BRG4 configuration register */ | ||
143 | __be32 brgc5; /* BRG5 configuration register */ | ||
144 | __be32 brgc6; /* BRG6 configuration register */ | ||
145 | __be32 brgc7; /* BRG7 configuration register */ | ||
146 | __be32 brgc8; /* BRG8 configuration register */ | ||
147 | __be32 brgc9; /* BRG9 configuration register */ | ||
148 | __be32 brgc10; /* BRG10 configuration register */ | ||
149 | __be32 brgc11; /* BRG11 configuration register */ | ||
150 | __be32 brgc12; /* BRG12 configuration register */ | ||
151 | __be32 brgc13; /* BRG13 configuration register */ | ||
152 | __be32 brgc14; /* BRG14 configuration register */ | ||
153 | __be32 brgc15; /* BRG15 configuration register */ | ||
154 | __be32 brgc16; /* BRG16 configuration register */ | ||
155 | u8 res0[0x40]; | 140 | u8 res0[0x40]; |
156 | } __attribute__ ((packed)); | 141 | } __attribute__ ((packed)); |
157 | 142 | ||