Skip to contentSkip to conversation

gpio: regmap: fix type clash

PATCH In review Michael Walle 2 participants 2 messages Jul 25, 2020 – Jul 26, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: regmap: fix type clash

GPIO_REGMAP_ADDR_ZERO() cast to unsigned long but the actual config parameters are unsigned int. We use unsigned int here because that is the type which is used by the underlying regmap.

Fixes ebe363197e52 ("gpio: add a reusable generic gpio_chip using regmap")
---
 include/linux/gpio/regmap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/gpio/regmap.h +1 -1
index 4c1e6b34e824..ad76f3d0a6ba 100644
@@ -8,7 +8,7 @@ struct gpio_regmap;
 struct irq_domain;
 struct regmap;
 
-#define GPIO_REGMAP_ADDR_ZERO ((unsigned long)(-1))
+#define GPIO_REGMAP_ADDR_ZERO ((unsigned int)(-1))
 #define GPIO_REGMAP_ADDR(addr) ((addr) ? : GPIO_REGMAP_ADDR_ZERO)
 
 /**
Signature · 1 line
2.20.1
#1 lore raw
Quoted 7 lines · Michael Walle

GPIO_REGMAP_ADDR_ZERO() cast to unsigned long but the actual config parameters are unsigned int. We use unsigned int here because that is the type which is used by the underlying regmap.

Fixes ebe363197e52 ("gpio: add a reusable generic gpio_chip using regmap")

Patch applied, thanks!

Yours,
Linus Walleij