diff mbox series

[1/2] gpio: stm32: cosmetic: cleanup gpio_stm32_probe

Message ID 20200909162834.31860-1-patrick.delaunay@st.com
State Accepted
Commit 15c8cbfc7482c07db0ba5307f31ea2423399fba9
Delegated to: Patrick Delaunay
Headers show
Series [1/2] gpio: stm32: cosmetic: cleanup gpio_stm32_probe | expand

Commit Message

Patrick DELAUNAY Sept. 9, 2020, 4:28 p.m. UTC
Move the variables definition at the beggining of the function
gpio_stm32_probe().

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

 drivers/gpio/stm32_gpio.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Patrice CHOTARD Oct. 2, 2020, 9:34 a.m. UTC | #1
Hi Patrick

On 9/9/20 6:28 PM, Patrick Delaunay wrote:
> Move the variables definition at the beggining of the function
> gpio_stm32_probe().
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/gpio/stm32_gpio.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
> index 5bff27f75b..aa70b1d2a9 100644
> --- a/drivers/gpio/stm32_gpio.c
> +++ b/drivers/gpio/stm32_gpio.c
> @@ -273,9 +273,12 @@ static const struct dm_gpio_ops gpio_stm32_ops = {
>  static int gpio_stm32_probe(struct udevice *dev)
>  {
>  	struct stm32_gpio_priv *priv = dev_get_priv(dev);
> +	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
> +	struct ofnode_phandle_args args;
> +	const char *name;
>  	struct clk clk;
>  	fdt_addr_t addr;
> -	int ret;
> +	int ret, i;
>  
>  	addr = dev_read_addr(dev);
>  	if (addr == FDT_ADDR_T_NONE)
> @@ -283,11 +286,6 @@ static int gpio_stm32_probe(struct udevice *dev)
>  
>  	priv->regs = (struct stm32_gpio_regs *)addr;
>  
> -	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
> -	struct ofnode_phandle_args args;
> -	const char *name;
> -	int i;
> -
>  	name = dev_read_string(dev, "st,bank-name");
>  	if (!name)
>  		return -EINVAL;

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

Thanks
Patrick DELAUNAY Oct. 2, 2020, 1:13 p.m. UTC | #2
Hi,

> From: Patrick DELAUNAY <patrick.delaunay@st.com>
> Sent: mercredi 9 septembre 2020 18:29
> 
> Move the variables definition at the beggining of the function gpio_stm32_probe().
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
> 
>  drivers/gpio/stm32_gpio.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 

Applied to u-boot-stm/next, thanks!

Regards

Patrick
diff mbox series

Patch

diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 5bff27f75b..aa70b1d2a9 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -273,9 +273,12 @@  static const struct dm_gpio_ops gpio_stm32_ops = {
 static int gpio_stm32_probe(struct udevice *dev)
 {
 	struct stm32_gpio_priv *priv = dev_get_priv(dev);
+	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+	struct ofnode_phandle_args args;
+	const char *name;
 	struct clk clk;
 	fdt_addr_t addr;
-	int ret;
+	int ret, i;
 
 	addr = dev_read_addr(dev);
 	if (addr == FDT_ADDR_T_NONE)
@@ -283,11 +286,6 @@  static int gpio_stm32_probe(struct udevice *dev)
 
 	priv->regs = (struct stm32_gpio_regs *)addr;
 
-	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-	struct ofnode_phandle_args args;
-	const char *name;
-	int i;
-
 	name = dev_read_string(dev, "st,bank-name");
 	if (!name)
 		return -EINVAL;