{
        int ret;
 
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
 
        map->lock(map->lock_arg);
 {
        int ret;
 
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
 
        map->lock(map->lock_arg);
 
        if (map->bus && !map->format.parse_inplace)
                return -EINVAL;
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
 
        /*
                        int reg = regs[i].reg;
                        if (!map->writeable_reg(map->dev, reg))
                                return -EINVAL;
-                       if (reg % map->reg_stride)
+                       if (!IS_ALIGNED(reg, map->reg_stride))
                                return -EINVAL;
                }
 
 
        if (val_len % map->format.val_bytes)
                return -EINVAL;
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
 
        map->lock(map->lock_arg);
 {
        int ret;
 
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
 
        map->lock(map->lock_arg);
                return -EINVAL;
        if (val_len % map->format.val_bytes)
                return -EINVAL;
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
        if (val_count == 0)
                return -EINVAL;
        size_t val_bytes = map->format.val_bytes;
        bool vol = regmap_volatile_range(map, reg, val_count);
 
-       if (reg % map->reg_stride)
+       if (!IS_ALIGNED(reg, map->reg_stride))
                return -EINVAL;
 
        if (map->bus && map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {