Skip to contentSkip to conversation

leds: pca9532: Assign gpio base dynamically

PATCH Applied Stefan Riedmueller 2 participants 2 messages Apr 14, 2021 – Apr 25, 2021

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

PATCH 1/1 leds: pca9532: Assign gpio base dynamically

When using devicetree, gpio_base holds its initial zero value which can lead to a rejection if another gpio controller already occupies this base. To prevent that collision let the gpio base be assigned dynamically.

---
 drivers/leds/leds-pca9532.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/leds/leds-pca9532.c +2 -0
index 27d027165472..017794bb87ae 100644
@@ -480,6 +480,8 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
 	if (!pdata)
 		return ERR_PTR(-ENOMEM);
 
+	pdata->gpio_base = -1;
+
 	of_property_read_u8_array(np, "nxp,pwm", &pdata->pwm[0],
 				  ARRAY_SIZE(pdata->pwm));
 	of_property_read_u8_array(np, "nxp,psc", &pdata->psc[0],
Signature · 1 line
2.25.1
Applied
#1 lore raw

Hi!

Quoted 5 lines

When using devicetree, gpio_base holds its initial zero value which can lead to a rejection if another gpio controller already occupies this base. To prevent that collision let the gpio base be assigned dynamically.

Thanks, applied.
Pavel

Signature · 1 line
http://www.livejournal.com/~pavelmachek