Merge tag 'docs-4.12-2' of git://git.lwn.net/linux
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / cm2xxx.c
index 3e5fd3587eb1870e16daa70d2e27001cb449f01a..cd90b4c6a06ba300d2261b91428e1666e26a7b72 100644 (file)
@@ -204,7 +204,7 @@ void omap2xxx_cm_apll96_disable(void)
  * XXX This function is only needed until absolute register addresses are
  * removed from the OMAP struct clk records.
  */
-static int omap2xxx_cm_split_idlest_reg(void __iomem *idlest_reg,
+static int omap2xxx_cm_split_idlest_reg(struct clk_omap_reg *idlest_reg,
                                        s16 *prcm_inst,
                                        u8 *idlest_reg_id)
 {
@@ -212,10 +212,7 @@ static int omap2xxx_cm_split_idlest_reg(void __iomem *idlest_reg,
        u8 idlest_offs;
        int i;
 
-       if (idlest_reg < cm_base || idlest_reg > (cm_base + 0x0fff))
-               return -EINVAL;
-
-       idlest_offs = (unsigned long)idlest_reg & 0xff;
+       idlest_offs = idlest_reg->offset & 0xff;
        for (i = 0; i < ARRAY_SIZE(omap2xxx_cm_idlest_offs); i++) {
                if (idlest_offs == omap2xxx_cm_idlest_offs[i]) {
                        *idlest_reg_id = i + 1;
@@ -226,7 +223,7 @@ static int omap2xxx_cm_split_idlest_reg(void __iomem *idlest_reg,
        if (i == ARRAY_SIZE(omap2xxx_cm_idlest_offs))
                return -EINVAL;
 
-       offs = idlest_reg - cm_base;
+       offs = idlest_reg->offset;
        offs &= 0xff00;
        *prcm_inst = offs;