[PATCH V4 04/62] ST SPEAr: Making clock functions more generic
From: Russell King - ARM Linux <hidden>
Date: 2011-01-18 15:56:20
From: Russell King - ARM Linux <hidden>
Date: 2011-01-18 15:56:20
On Tue, Jan 18, 2011 at 12:41:32PM +0530, Viresh Kumar wrote:
/* pll1 configuration structure */
static struct pll_clk_config pll1_config = {
.mode_reg = PLL1_CTR,
.cfg_reg = PLL1_FRQ,
+ .masks = &pll1_masks,
};
/* PLL1 clock */...
- mode = (readl(config->mode_reg) >> PLL_MODE_SHIFT) & - PLL_MODE_MASK; + mode = (readl(config->mode_reg) >> config->masks->mode_shift) & + config->masks->mode_mask;
...
struct pll_clk_config {
- unsigned int *mode_reg;
- unsigned int *cfg_reg;
+ u32 *mode_reg;
+ u32 *cfg_reg;
+ struct pll_clk_masks *masks;
};Registers should have an __iomem attribute on them. Preferably, but not absolutely necessary, should be void to prevent any direct dereferencing.