clk: socfpga: switch to GENMASK()
[firefly-linux-kernel-4.4.55.git] / drivers / clk / socfpga / clk-gate-a10.c
index 538ca504dea150d0a0f3092c098781d849799958..1cebf253e8fd44dbe22e37e1eb6a18ed63cd2f14 100644 (file)
@@ -39,7 +39,7 @@ static unsigned long socfpga_gate_clk_recalc_rate(struct clk_hw *hwclk,
                div = socfpgaclk->fixed_div;
        else if (socfpgaclk->div_reg) {
                val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift;
-               val &= div_mask(socfpgaclk->width);
+               val &= GENMASK(socfpgaclk->width - 1, 0);
                div = (1 << val);
        }