summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-sx150x.c
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2018-01-17 14:34:23 +0100
committerLinus Walleij <linus.walleij@linaro.org>2018-01-18 11:04:47 +0100
commitb930151e5b55a0e62a3aad06876de891ac980471 (patch)
tree29f9adfd89a78bfa941ad0ea079f0e33483793d5 /drivers/pinctrl/pinctrl-sx150x.c
parentpinctrl: sx150x: Register pinctrl before adding the gpiochip (diff)
downloadlinux-b930151e5b55a0e62a3aad06876de891ac980471.tar.xz
linux-b930151e5b55a0e62a3aad06876de891ac980471.zip
pinctrl: sx150x: Add a static gpio/pinctrl pin range mapping
Without such a range, gpiolib fails with -EPROBE_DEFER, pending the addition of the range. So, without a range, gpiolib will keep deferring indefinitely. Cc: stable@vger.kernel.org Fixes: 9e80f9064e73 ("pinctrl: Add SX150X GPIO Extender Pinctrl Driver") Fixes: e10f72bf4b3e ("gpio: gpiolib: Generalise state persistence beyond sleep") Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-sx150x.c')
-rw-r--r--drivers/pinctrl/pinctrl-sx150x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
index 049dd15e04ef..cbf58a10113d 100644
--- a/drivers/pinctrl/pinctrl-sx150x.c
+++ b/drivers/pinctrl/pinctrl-sx150x.c
@@ -1193,6 +1193,11 @@ static int sx150x_probe(struct i2c_client *client,
if (ret)
return ret;
+ ret = gpiochip_add_pin_range(&pctl->gpio, dev_name(dev),
+ 0, 0, pctl->data->npins);
+ if (ret)
+ return ret;
+
/* Add Interrupt support if an irq is specified */
if (client->irq > 0) {
pctl->irq_chip.name = devm_kstrdup(dev, client->name,