[PATCH v2 20/33] reset: stm32-reset: migrate trace to dev and log macro
Patrick Delaunay
patrick.delaunay at st.com
Fri Nov 6 19:01:48 CET 2020
Change debug to dev_dbg macro and define LOG_CATEGORY.
Remove the "%s:" __func__ header as it is managed by dev macro
(dev->name is displayed).
Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
Reviewed-by: Patrice Chotard <patrice.chotard at st.com>
---
(no changes since v1)
drivers/reset/stm32-reset.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/reset/stm32-reset.c b/drivers/reset/stm32-reset.c
index 64a11cfcfc..c3af06c6f5 100644
--- a/drivers/reset/stm32-reset.c
+++ b/drivers/reset/stm32-reset.c
@@ -4,6 +4,8 @@
* Author(s): Patrice Chotard, <patrice.chotard at st.com> for STMicroelectronics.
*/
+#define LOG_CATEGORY UCLASS_RESET
+
#include <common.h>
#include <dm.h>
#include <errno.h>
@@ -12,6 +14,7 @@
#include <reset-uclass.h>
#include <stm32_rcc.h>
#include <asm/io.h>
+#include <dm/device_compat.h>
#include <linux/bitops.h>
/* reset clear offset for STM32MP RCC */
@@ -36,8 +39,9 @@ static int stm32_reset_assert(struct reset_ctl *reset_ctl)
struct stm32_reset_priv *priv = dev_get_priv(reset_ctl->dev);
int bank = (reset_ctl->id / BITS_PER_LONG) * 4;
int offset = reset_ctl->id % BITS_PER_LONG;
- debug("%s: reset id = %ld bank = %d offset = %d)\n", __func__,
- reset_ctl->id, bank, offset);
+
+ dev_dbg(reset_ctl->dev, "reset id = %ld bank = %d offset = %d)\n",
+ reset_ctl->id, bank, offset);
if (dev_get_driver_data(reset_ctl->dev) == STM32MP1)
/* reset assert is done in rcc set register */
@@ -53,8 +57,9 @@ static int stm32_reset_deassert(struct reset_ctl *reset_ctl)
struct stm32_reset_priv *priv = dev_get_priv(reset_ctl->dev);
int bank = (reset_ctl->id / BITS_PER_LONG) * 4;
int offset = reset_ctl->id % BITS_PER_LONG;
- debug("%s: reset id = %ld bank = %d offset = %d)\n", __func__,
- reset_ctl->id, bank, offset);
+
+ dev_dbg(reset_ctl->dev, "reset id = %ld bank = %d offset = %d)\n",
+ reset_ctl->id, bank, offset);
if (dev_get_driver_data(reset_ctl->dev) == STM32MP1)
/* reset deassert is done in rcc clr register */
--
2.17.1
More information about the U-Boot
mailing list