From: Maxime Chevallier Date: Thu, 11 May 2023 14:27:35 +0000 (+0200) Subject: regmap: mmio: Allow passing an empty config->reg_stride X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e12ff28764937dd58c8613f16065da60da149048;p=linux.git regmap: mmio: Allow passing an empty config->reg_stride Regmap's stride is used for MMIO regmaps to check the correctness of reg_width. However, it's acceptable to pass an empty config->reg_stride, in that case the actual stride used is 1. There are valid cases now to pass an empty stride, when using down/upshifting of register address. In this case, the stride value loses its sense, so ignore the reg_width when the stride isn't set. Signed-off-by: Maxime Chevallier reg_stride < min_stride) + if (config->reg_stride && config->reg_stride < min_stride) return ERR_PTR(-EINVAL); if (config->use_relaxed_mmio && config->io_port)