clk: socfpga: switch to GENMASK()
[firefly-linux-kernel-4.4.55.git] / drivers / clk / socfpga / clk-periph-a10.c
index 64f93acbbd259729964db5fdce37c9f3e74cc266..1f397cb72e89a8ff421edfaf92cddf2fee1e16a8 100644 (file)
@@ -38,7 +38,7 @@ static unsigned long clk_periclk_recalc_rate(struct clk_hw *hwclk,
                div = socfpgaclk->fixed_div;
        } else if (socfpgaclk->div_reg) {
                div = readl(socfpgaclk->div_reg) >> socfpgaclk->shift;
-               div &= div_mask(socfpgaclk->width);
+               div &= GENMASK(socfpgaclk->width - 1, 0);
                div += 1;
        } else {
                div = ((readl(socfpgaclk->hw.reg) & 0x7ff) + 1);