refactor(st-pmic): use LOG_LEVEL for regulator debug output
The stpmic2_dump_regulators() function now uses LOG_LEVEL instead of
EVENT_LOG_LEVEL to align with general logging conventions.
Additionally, the guard has been moved inside the function, removing
unnecessary preprocessor checks where the function is used and thereby
improving consistency.
Change-Id: I087de124e6795a599b4f91a7613c6dfa3f76bb7a
Signed-off-by: Boerge Struempfel <boerge.struempfel@gmail.com>
diff --git a/drivers/st/pmic/stm32mp_pmic2.c b/drivers/st/pmic/stm32mp_pmic2.c
index c19d36a..fcf3fd9 100644
--- a/drivers/st/pmic/stm32mp_pmic2.c
+++ b/drivers/st/pmic/stm32mp_pmic2.c
@@ -493,7 +493,5 @@
panic();
}
-#if EVENT_LOG_LEVEL == LOG_LEVEL_VERBOSE
stpmic2_dump_regulators(pmic2);
-#endif
}
diff --git a/drivers/st/pmic/stpmic2.c b/drivers/st/pmic/stpmic2.c
index 7f233db..b3af3e0 100644
--- a/drivers/st/pmic/stpmic2.c
+++ b/drivers/st/pmic/stpmic2.c
@@ -434,9 +434,9 @@
return -EPERM;
}
-#if EVENT_LOG_LEVEL == LOG_LEVEL_VERBOSE
void stpmic2_dump_regulators(struct pmic_handle_s *pmic)
{
+#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
size_t i;
char const *name;
@@ -456,8 +456,8 @@
VERBOSE("PMIC regul %s: %s, %dmV\n",
name, state ? "EN" : "DIS", val);
}
-}
#endif
+}
int stpmic2_get_version(struct pmic_handle_s *pmic, uint8_t *val)
{
diff --git a/include/drivers/st/stpmic2.h b/include/drivers/st/stpmic2.h
index 58ba64a..edb56e0 100644
--- a/include/drivers/st/stpmic2.h
+++ b/include/drivers/st/stpmic2.h
@@ -291,9 +291,7 @@
int stpmic2_regulator_set_voltage(struct pmic_handle_s *pmic,
uint8_t id, uint16_t millivolts);
-#if EVENT_LOG_LEVEL == LOG_LEVEL_VERBOSE
void stpmic2_dump_regulators(struct pmic_handle_s *pmic);
-#endif
int stpmic2_get_version(struct pmic_handle_s *pmic, uint8_t *val);
int stpmic2_get_product_id(struct pmic_handle_s *pmic, uint8_t *val);