diff mbox series

[v2,06/11] gpio: stmfx: rename function used to change pin configuration

Message ID 20200604123033.25499-4-patrick.delaunay@st.com
State Accepted
Delegated to: Patrick Delaunay
Headers show
Series stm32mp1: activate gpio hog support and add new pinctrl ops | expand

Commit Message

Patrick DELAUNAY June 4, 2020, 12:30 p.m. UTC
Rename the two function used to change the pin configuration
from stmfx_pinctrl_.. stmfx_conf_... to clarify the function usage.

No functional change.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

Changes in v2:
- NEW: split previous patch [5/5] gpio: stmfx: add set_config ops

 drivers/pinctrl/pinctrl-stmfx.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

Comments

Patrice CHOTARD July 2, 2020, 7:51 a.m. UTC | #1
Hi Patrick

On 6/4/20 2:30 PM, Patrick Delaunay wrote:
> Rename the two function used to change the pin configuration
> from stmfx_pinctrl_.. stmfx_conf_... to clarify the function usage.
>
> No functional change.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
> Changes in v2:
> - NEW: split previous patch [5/5] gpio: stmfx: add set_config ops
>
>  drivers/pinctrl/pinctrl-stmfx.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
> index d74121725c..657ca2e240 100644
> --- a/drivers/pinctrl/pinctrl-stmfx.c
> +++ b/drivers/pinctrl/pinctrl-stmfx.c
> @@ -74,8 +74,7 @@ static int stmfx_write(struct udevice *dev, uint offset, unsigned int val)
>  	return dm_i2c_reg_write(dev_get_parent(dev), offset, val);
>  }
>  
> -static int stmfx_pinctrl_set_pupd(struct udevice *dev,
> -				  unsigned int pin, u32 pupd)
> +static int stmfx_conf_set_pupd(struct udevice *dev, unsigned int pin, u32 pupd)
>  {
>  	u8 reg = STMFX_REG_GPIO_PUPD + get_reg(pin);
>  	u32 mask = get_mask(pin);
> @@ -89,8 +88,7 @@ static int stmfx_pinctrl_set_pupd(struct udevice *dev,
>  	return stmfx_write(dev, reg, ret);
>  }
>  
> -static int stmfx_pinctrl_set_type(struct udevice *dev,
> -				  unsigned int pin, u32 type)
> +static int stmfx_conf_set_type(struct udevice *dev, unsigned int pin, u32 type)
>  {
>  	u8 reg = STMFX_REG_GPIO_TYPE + get_reg(pin);
>  	u32 mask = get_mask(pin);
> @@ -235,22 +233,22 @@ static int stmfx_pinctrl_conf_set(struct udevice *dev, unsigned int pin,
>  	case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
>  	case PIN_CONFIG_BIAS_DISABLE:
>  	case PIN_CONFIG_DRIVE_PUSH_PULL:
> -		ret = stmfx_pinctrl_set_type(dev, pin, 0);
> +		ret = stmfx_conf_set_type(dev, pin, 0);
>  		break;
>  	case PIN_CONFIG_BIAS_PULL_DOWN:
> -		ret = stmfx_pinctrl_set_type(dev, pin, 1);
> +		ret = stmfx_conf_set_type(dev, pin, 1);
>  		if (ret)
>  			return ret;
> -		ret = stmfx_pinctrl_set_pupd(dev, pin, 0);
> +		ret = stmfx_conf_set_pupd(dev, pin, 0);
>  		break;
>  	case PIN_CONFIG_BIAS_PULL_UP:
> -		ret = stmfx_pinctrl_set_type(dev, pin, 1);
> +		ret = stmfx_conf_set_type(dev, pin, 1);
>  		if (ret)
>  			return ret;
> -		ret = stmfx_pinctrl_set_pupd(dev, pin, 1);
> +		ret = stmfx_conf_set_pupd(dev, pin, 1);
>  		break;
>  	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
> -		ret = stmfx_pinctrl_set_type(dev, pin, 1);
> +		ret = stmfx_conf_set_type(dev, pin, 1);
>  		break;
>  	case PIN_CONFIG_OUTPUT:
>  		ret = stmfx_gpio_direction_output(plat->gpio, pin, arg);

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index d74121725c..657ca2e240 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -74,8 +74,7 @@  static int stmfx_write(struct udevice *dev, uint offset, unsigned int val)
 	return dm_i2c_reg_write(dev_get_parent(dev), offset, val);
 }
 
-static int stmfx_pinctrl_set_pupd(struct udevice *dev,
-				  unsigned int pin, u32 pupd)
+static int stmfx_conf_set_pupd(struct udevice *dev, unsigned int pin, u32 pupd)
 {
 	u8 reg = STMFX_REG_GPIO_PUPD + get_reg(pin);
 	u32 mask = get_mask(pin);
@@ -89,8 +88,7 @@  static int stmfx_pinctrl_set_pupd(struct udevice *dev,
 	return stmfx_write(dev, reg, ret);
 }
 
-static int stmfx_pinctrl_set_type(struct udevice *dev,
-				  unsigned int pin, u32 type)
+static int stmfx_conf_set_type(struct udevice *dev, unsigned int pin, u32 type)
 {
 	u8 reg = STMFX_REG_GPIO_TYPE + get_reg(pin);
 	u32 mask = get_mask(pin);
@@ -235,22 +233,22 @@  static int stmfx_pinctrl_conf_set(struct udevice *dev, unsigned int pin,
 	case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
 	case PIN_CONFIG_BIAS_DISABLE:
 	case PIN_CONFIG_DRIVE_PUSH_PULL:
-		ret = stmfx_pinctrl_set_type(dev, pin, 0);
+		ret = stmfx_conf_set_type(dev, pin, 0);
 		break;
 	case PIN_CONFIG_BIAS_PULL_DOWN:
-		ret = stmfx_pinctrl_set_type(dev, pin, 1);
+		ret = stmfx_conf_set_type(dev, pin, 1);
 		if (ret)
 			return ret;
-		ret = stmfx_pinctrl_set_pupd(dev, pin, 0);
+		ret = stmfx_conf_set_pupd(dev, pin, 0);
 		break;
 	case PIN_CONFIG_BIAS_PULL_UP:
-		ret = stmfx_pinctrl_set_type(dev, pin, 1);
+		ret = stmfx_conf_set_type(dev, pin, 1);
 		if (ret)
 			return ret;
-		ret = stmfx_pinctrl_set_pupd(dev, pin, 1);
+		ret = stmfx_conf_set_pupd(dev, pin, 1);
 		break;
 	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
-		ret = stmfx_pinctrl_set_type(dev, pin, 1);
+		ret = stmfx_conf_set_type(dev, pin, 1);
 		break;
 	case PIN_CONFIG_OUTPUT:
 		ret = stmfx_gpio_direction_output(plat->gpio, pin, arg);