[PATCH v3 7/7] ARM: imx: switch to clk_div_mask()

From: Andy Shevchenko
Date: Tue Mar 31 2015 - 13:23:11 EST


Convert the code to use clk_div_mask() helper instead of div_mask() macro.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
arch/arm/mach-imx/clk-fixup-div.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/clk-fixup-div.c b/arch/arm/mach-imx/clk-fixup-div.c
index 21db020..e5a83bc 100644
--- a/arch/arm/mach-imx/clk-fixup-div.c
+++ b/arch/arm/mach-imx/clk-fixup-div.c
@@ -16,7 +16,6 @@
#include "clk.h"

#define to_clk_div(_hw) container_of(_hw, struct clk_divider, hw)
-#define div_mask(d) ((1 << (d->width)) - 1)

/**
* struct clk_fixup_div - imx integer fixup divider clock
@@ -70,13 +69,13 @@ static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate,
/* Zero based divider */
value = divider - 1;

- if (value > div_mask(div))
- value = div_mask(div);
+ if (value > clk_div_mask(div->width))
+ value = clk_div_mask(div->width);

spin_lock_irqsave(div->lock, flags);

val = readl(div->reg);
- val &= ~(div_mask(div) << div->shift);
+ val &= ~(clk_div_mask(div->width) << div->shift);
val |= value << div->shift;
fixup_div->fixup(&val);
writel(val, div->reg);
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/