Skip to content

Commit

Permalink
leds: pca9532: Assign gpio base dynamically
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Riedmueller authored and Pavel Machek committed Apr 25, 2021
1 parent 5fe09e1 commit 23a7004
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/leds/leds-pca9532.c
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 23a7004

Please sign in to comment.