Skip to content

Commit 4650b7c

Browse files
Dong Aishenglinusw
authored andcommitted
pinctrl: support gpio request deferred probing
As pinctrl handles, it may be possible the pinctrl gpio ranges are still not got registered when user call pinctrl_gpio_request. Thus, add defer support for it too. Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 5b3aa5f commit 4650b7c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/pinctrl/core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ pinctrl_match_gpio_range(struct pinctrl_dev *pctldev, unsigned gpio)
291291
*
292292
* Find the pin controller handling a certain GPIO pin from the pinspace of
293293
* the GPIO subsystem, return the device and the matching GPIO range. Returns
294-
* negative if the GPIO range could not be found in any device.
294+
* -EPROBE_DEFER if the GPIO range could not be found in any device since it
295+
* may still have not been registered.
295296
*/
296297
static int pinctrl_get_device_gpio_range(unsigned gpio,
297298
struct pinctrl_dev **outdev,
@@ -311,7 +312,7 @@ static int pinctrl_get_device_gpio_range(unsigned gpio,
311312
}
312313
}
313314

314-
return -EINVAL;
315+
return -EPROBE_DEFER;
315316
}
316317

317318
/**
@@ -397,7 +398,7 @@ int pinctrl_request_gpio(unsigned gpio)
397398
ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
398399
if (ret) {
399400
mutex_unlock(&pinctrl_mutex);
400-
return -EINVAL;
401+
return ret;
401402
}
402403

403404
/* Convert to the pin controllers number space */

0 commit comments

Comments
 (0)