Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dong Aisheng and committed by
Linus Walleij
4650b7cb 5b3aa5f7

+4 -3
+4 -3
drivers/pinctrl/core.c
··· 291 291 * 292 292 * Find the pin controller handling a certain GPIO pin from the pinspace of 293 293 * 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. 295 296 */ 296 297 static int pinctrl_get_device_gpio_range(unsigned gpio, 297 298 struct pinctrl_dev **outdev, ··· 312 311 } 313 312 } 314 313 315 - return -EINVAL; 314 + return -EPROBE_DEFER; 316 315 } 317 316 318 317 /** ··· 398 397 ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); 399 398 if (ret) { 400 399 mutex_unlock(&pinctrl_mutex); 401 - return -EINVAL; 400 + return ret; 402 401 } 403 402 404 403 /* Convert to the pin controllers number space */