From: Marek Vasut Date: Sun, 21 Apr 2019 20:46:25 +0000 (+0200) Subject: pinctrl: renesas: Set pin type in sh_pfc_config_mux_for_gpio X-Git-Tag: v2019.07-rc2~18^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50e6901fec0bd7dbfb2e39e750119ee0c78160c5;p=platform%2Fkernel%2Fu-boot.git pinctrl: renesas: Set pin type in sh_pfc_config_mux_for_gpio Add missing cfg->type = PINMUX_TYPE_GPIO upon successfully setting pin as a GPIO to retain the pin configuration information. Signed-off-by: Marek Vasut Cc: Alex Kiernan Cc: Christoph Muellner Cc: Eugeniu Rosca Cc: Patrice Chotard Cc: Patrick DELAUNAY Cc: Philipp Tomsich Cc: Simon Glass --- diff --git a/drivers/pinctrl/renesas/pfc.c b/drivers/pinctrl/renesas/pfc.c index 0635950..59dc4af 100644 --- a/drivers/pinctrl/renesas/pfc.c +++ b/drivers/pinctrl/renesas/pfc.c @@ -466,7 +466,7 @@ int sh_pfc_config_mux_for_gpio(struct udevice *dev, unsigned pin_selector) struct sh_pfc *pfc = &priv->pfc; struct sh_pfc_pin_config *cfg; const struct sh_pfc_pin *pin = NULL; - int i, idx; + int i, ret, idx; for (i = 1; i < pfc->info->nr_pins; i++) { if (priv->pfc.info->pins[i].pin != pin_selector) @@ -485,7 +485,13 @@ int sh_pfc_config_mux_for_gpio(struct udevice *dev, unsigned pin_selector) if (cfg->type != PINMUX_TYPE_NONE) return -EBUSY; - return sh_pfc_config_mux(pfc, pin->enum_id, PINMUX_TYPE_GPIO); + ret = sh_pfc_config_mux(pfc, pin->enum_id, PINMUX_TYPE_GPIO); + if (ret) + return ret; + + cfg->type = PINMUX_TYPE_GPIO; + + return 0; } static int sh_pfc_pinctrl_pin_set(struct udevice *dev, unsigned pin_selector,