diff options
author | Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> | 2021-06-03 07:41:37 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-21 14:08:39 +0200 |
commit | 157d2230193ae683fcffcc1cd0a2c3aa4479955f (patch) | |
tree | f5ac0877ce96d72bbf037b300c70a1f6544fe827 /drivers/regulator/internal.h | |
parent | regulator: add warning flags (diff) | |
download | linux-157d2230193ae683fcffcc1cd0a2c3aa4479955f.tar.xz linux-157d2230193ae683fcffcc1cd0a2c3aa4479955f.zip |
regulator: move rdev_print helpers to internal.h
The rdev print helpers are a nice way to print messages related to a
specific regulator device. Move them from core.c to internal.h
As the rdev print helpers use rdev_get_name() export it from core.c. Also
move the declaration from coupler.h to driver.h because the rdev name is
not just a coupled regulator property. I guess the main audience for
rdev_get_name() will be the regulator core and drivers.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/dc7fd70dc31de4d0e820b7646bb78eeb04f80735.1622628333.git.matti.vaittinen@fi.rohmeurope.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/internal.h')
-rw-r--r-- | drivers/regulator/internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/regulator/internal.h b/drivers/regulator/internal.h index 2391b565ef11..1e9c71642143 100644 --- a/drivers/regulator/internal.h +++ b/drivers/regulator/internal.h @@ -15,6 +15,17 @@ #define REGULATOR_STATES_NUM (PM_SUSPEND_MAX + 1) +#define rdev_crit(rdev, fmt, ...) \ + pr_crit("%s: " fmt, rdev_get_name(rdev), ##__VA_ARGS__) +#define rdev_err(rdev, fmt, ...) \ + pr_err("%s: " fmt, rdev_get_name(rdev), ##__VA_ARGS__) +#define rdev_warn(rdev, fmt, ...) \ + pr_warn("%s: " fmt, rdev_get_name(rdev), ##__VA_ARGS__) +#define rdev_info(rdev, fmt, ...) \ + pr_info("%s: " fmt, rdev_get_name(rdev), ##__VA_ARGS__) +#define rdev_dbg(rdev, fmt, ...) \ + pr_debug("%s: " fmt, rdev_get_name(rdev), ##__VA_ARGS__) + struct regulator_voltage { int min_uV; int max_uV; |