[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>
This commit is contained in:

committed by
Paul Mackerras

parent
0613ffbf53
commit
fc9e8b4e27
@@ -175,8 +175,7 @@ void qe_setbrg(u32 brg, u32 rate)
|
||||
u32 divisor, tempval;
|
||||
int div16 = 0;
|
||||
|
||||
bp = &qe_immr->brg.brgc1;
|
||||
bp += brg;
|
||||
bp = &qe_immr->brg.brgc[brg];
|
||||
|
||||
divisor = (get_brg_clk() / rate);
|
||||
if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
|
||||
|
Reference in New Issue
Block a user