linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regmap: regmap-irq: fix getting type default values
@ 2019-03-28 16:22 Srinivas Kandagatla
  2019-04-01  9:46 ` Vaittinen, Matti
  0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Kandagatla @ 2019-03-28 16:22 UTC (permalink / raw)
  To: broonie
  Cc: gregkh, rafael, matti.vaittinen, linux-kernel, Srinivas Kandagatla

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@linaro.org>
---
 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);
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: regmap-irq: fix getting type default values
  2019-03-28 16:22 [PATCH] regmap: regmap-irq: fix getting type default values Srinivas Kandagatla
@ 2019-04-01  9:46 ` Vaittinen, Matti
  0 siblings, 0 replies; 2+ messages in thread
From: Vaittinen, Matti @ 2019-04-01  9:46 UTC (permalink / raw)
  To: srinivas.kandagatla, broonie; +Cc: linux-kernel, gregkh, rafael

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@linaro.org>
Acked-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

> ---
>  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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-01 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28 16:22 [PATCH] regmap: regmap-irq: fix getting type default values Srinivas Kandagatla
2019-04-01  9:46 ` Vaittinen, Matti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).