summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorStefan Riedmueller <s.riedmueller@phytec.de>2021-04-14 13:51:24 +0200
committerPavel Machek <pavel@ucw.cz>2021-04-25 23:59:58 +0200
commit23a700455a1bc55f3ea20675e574181b8c129306 (patch)
tree1688753f7e4dda6e84ee8667074b1fde321f3ebf /drivers/leds
parent5fe09e16c689eae88a151c2f8199c73cf6f18d7d (diff)
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. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-pca9532.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 27d027165472..017794bb87ae 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -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],