diff mbox series

[05/33] gpio: stm32-gpio: migrate trace to dev and log macro

Message ID 20201014091646.4233-6-patrick.delaunay@st.com
State Superseded
Delegated to: Patrice Chotard
Headers show
Series stm32: enable logging features | expand

Commit Message

Patrick DELAUNAY Oct. 14, 2020, 9:16 a.m. UTC
Change debug to dev_dbg macro and define LOG_CATEGORY.

Remove dev->name as it is already displayed by dev macro.

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

 drivers/gpio/stm32_gpio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Patrice CHOTARD Oct. 21, 2020, 12:24 p.m. UTC | #1
Hi Patrick

On 10/14/20 11:16 AM, Patrick Delaunay wrote:
> Change debug to dev_dbg macro and define LOG_CATEGORY.
>
> Remove dev->name as it is already displayed by dev macro.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/gpio/stm32_gpio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
> index 473e364796..3b17b632db 100644
> --- a/drivers/gpio/stm32_gpio.c
> +++ b/drivers/gpio/stm32_gpio.c
> @@ -4,6 +4,8 @@
>   * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
>   */
>  
> +#define LOG_CATEGORY UCLASS_GPIO
> +
>  #include <common.h>
>  #include <clk.h>
>  #include <dm.h>
> @@ -329,7 +331,7 @@ static int gpio_stm32_probe(struct udevice *dev)
>  		dev_err(dev, "failed to enable clock\n");
>  		return ret;
>  	}
> -	debug("clock enabled for device %s\n", dev->name);
> +	dev_dbg(dev, "clock enabled\n");
>  
>  	return 0;
>  }

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

Thanks
Patrice CHOTARD Oct. 21, 2020, 12:29 p.m. UTC | #2
Hi Patrick

On 10/14/20 11:16 AM, Patrick Delaunay wrote:
> Change debug to dev_dbg macro and define LOG_CATEGORY.
>
> Remove dev->name as it is already displayed by dev macro.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/gpio/stm32_gpio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
> index 473e364796..3b17b632db 100644
> --- a/drivers/gpio/stm32_gpio.c
> +++ b/drivers/gpio/stm32_gpio.c
> @@ -4,6 +4,8 @@
>   * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
>   */
>  
> +#define LOG_CATEGORY UCLASS_GPIO
> +
>  #include <common.h>
>  #include <clk.h>
>  #include <dm.h>
> @@ -329,7 +331,7 @@ static int gpio_stm32_probe(struct udevice *dev)
>  		dev_err(dev, "failed to enable clock\n");
>  		return ret;
>  	}
> -	debug("clock enabled for device %s\n", dev->name);
> +	dev_dbg(dev, "clock enabled\n");
>  
>  	return 0;
>  }

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

Thanks
diff mbox series

Patch

diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 473e364796..3b17b632db 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -4,6 +4,8 @@ 
  * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
  */
 
+#define LOG_CATEGORY UCLASS_GPIO
+
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
@@ -329,7 +331,7 @@  static int gpio_stm32_probe(struct udevice *dev)
 		dev_err(dev, "failed to enable clock\n");
 		return ret;
 	}
-	debug("clock enabled for device %s\n", dev->name);
+	dev_dbg(dev, "clock enabled\n");
 
 	return 0;
 }