Re: [PATCH] regmap: regmap-irq: fix getting type default values

From: Vaittinen, Matti
Date: Mon Apr 01 2019 - 06:02:03 EST


On Thu, 2019-03-28 at 16:22 +0000, Srinivas Kandagatla wrote:
> Checking for value of type default value just after allocating will
> always be zero and the type register default values will never be
> read,
> so fix this!
>
> Without this patch setting irq type will be silently ignored.
> Patch "regmap: regmap-irq: Remove default irq type setting from core"
> did remove the default mask but it forgot to remove the check before
> reading the default type register.
>
> Fixes: 84267d1b18ab ("regmap: regmap-irq: Remove default irq type
> setting from core")
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
Acked-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>

> ---
> drivers/base/regmap/regmap-irq.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/base/regmap/regmap-irq.c
> b/drivers/base/regmap/regmap-irq.c
> index 5059748afd4c..02eb75646141 100644
> --- a/drivers/base/regmap/regmap-irq.c
> +++ b/drivers/base/regmap/regmap-irq.c
> @@ -761,9 +761,6 @@ int regmap_add_irq_chip(struct regmap *map, int
> irq, int irq_flags,
>
> if (chip->num_type_reg && !chip->type_in_mask) {
> for (i = 0; i < chip->num_type_reg; ++i) {
> - if (!d->type_buf_def[i])
> - continue;
> -
> reg = chip->type_base +
> (i * map->reg_stride * d-
> >type_reg_stride);
>
It looks like I left a bug there. Thanks for the fix!

Br,
Matti