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>
This commit is contained in:
Boerge Struempfel 2025-04-01 09:58:47 +02:00
parent 1eb8983f6f
commit f08f6fbfda
No known key found for this signature in database
GPG key ID: 9557AEA0BDE5D28A
3 changed files with 2 additions and 6 deletions

View file

@ -493,7 +493,5 @@ void initialize_pmic(void)
panic(); panic();
} }
#if EVENT_LOG_LEVEL == LOG_LEVEL_VERBOSE
stpmic2_dump_regulators(pmic2); stpmic2_dump_regulators(pmic2);
#endif
} }

View file

@ -434,9 +434,9 @@ int stpmic2_regulator_set_prop(struct pmic_handle_s *pmic, uint8_t id,
return -EPERM; return -EPERM;
} }
#if EVENT_LOG_LEVEL == LOG_LEVEL_VERBOSE
void stpmic2_dump_regulators(struct pmic_handle_s *pmic) void stpmic2_dump_regulators(struct pmic_handle_s *pmic)
{ {
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
size_t i; size_t i;
char const *name; char const *name;
@ -456,8 +456,8 @@ void stpmic2_dump_regulators(struct pmic_handle_s *pmic)
VERBOSE("PMIC regul %s: %s, %dmV\n", VERBOSE("PMIC regul %s: %s, %dmV\n",
name, state ? "EN" : "DIS", val); name, state ? "EN" : "DIS", val);
} }
}
#endif #endif
}
int stpmic2_get_version(struct pmic_handle_s *pmic, uint8_t *val) int stpmic2_get_version(struct pmic_handle_s *pmic, uint8_t *val)
{ {

View file

@ -291,9 +291,7 @@ int stpmic2_regulator_get_voltage(struct pmic_handle_s *pmic,
int stpmic2_regulator_set_voltage(struct pmic_handle_s *pmic, int stpmic2_regulator_set_voltage(struct pmic_handle_s *pmic,
uint8_t id, uint16_t millivolts); uint8_t id, uint16_t millivolts);
#if EVENT_LOG_LEVEL == LOG_LEVEL_VERBOSE
void stpmic2_dump_regulators(struct pmic_handle_s *pmic); 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_version(struct pmic_handle_s *pmic, uint8_t *val);
int stpmic2_get_product_id(struct pmic_handle_s *pmic, uint8_t *val); int stpmic2_get_product_id(struct pmic_handle_s *pmic, uint8_t *val);