From c05127c4e2c6e7d9949347a76fd05c337bcd5e84 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 10 Apr 2012 10:00:38 +0200 Subject: pinctrl: implement pinctrl deferred probing If drivers try to obtain pinctrl handles for a pin controller that has not yet registered to the subsystem, we need to be able to back out and retry with deferred probing. So let's return -EPROBE_DEFER whenever this location fails. Also downgrade the errors to info, maybe we will even set them to debug once the deferred probing is commonplace. Cc: Arnd Bergmann Reviewed-by: Mark Brown Acked-by: Stephen Warren Signed-off-by: Linus Walleij --- drivers/pinctrl/core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/pinctrl/core.c') diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 7ff869007ba4..59027ab8347a 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -518,11 +518,14 @@ static int add_setting(struct pinctrl *p, struct pinctrl_map const *map) setting->pctldev = get_pinctrl_dev_from_devname(map->ctrl_dev_name); if (setting->pctldev == NULL) { - dev_err(p->dev, "unknown pinctrl device %s in map entry", + dev_info(p->dev, "unknown pinctrl device %s in map entry, deferring probe", map->ctrl_dev_name); kfree(setting); - /* Eventually, this should trigger deferred probe */ - return -ENODEV; + /* + * OK let us guess that the driver is not there yet, and + * let's defer obtaining this pinctrl handle to later... + */ + return -EPROBE_DEFER; } switch (map->type) { -- cgit v1.2.3