From: Patrice Chotard Date: Tue, 3 Dec 2024 10:06:10 +0000 (+0100) Subject: power: regulator: replace some debug() by dev_dbg() X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B?a=commitdiff_plain;h=ccddb0abec37f4628224ec20846b001a3e85e951;p=u-boot.git power: regulator: replace some debug() by dev_dbg() Replace some debug() by dev_dbg() when dev variable is available/valid. Signed-off-by: Patrice Chotard Reviewed-by: Quentin Schulz Reviewed-by: Jaehoon Chung --- diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index decd0802c8..80ea5e65d4 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -43,8 +44,7 @@ static void regulator_set_value_ramp_delay(struct udevice *dev, int old_uV, { int delay = DIV_ROUND_UP(abs(new_uV - old_uV), ramp_delay); - debug("regulator %s: delay %u us (%d uV -> %d uV)\n", dev->name, delay, - old_uV, new_uV); + dev_dbg(dev, "delay %u us (%d uV -> %d uV)\n", delay, old_uV, new_uV); udelay(delay); } @@ -263,7 +263,7 @@ int regulator_get_by_platname(const char *plat_name, struct udevice **devp) for (ret = uclass_find_first_device(UCLASS_REGULATOR, &dev); dev; ret = uclass_find_next_device(&dev)) { if (ret) { - debug("regulator %s, ret=%d\n", dev->name, ret); + dev_dbg(dev, "ret=%d\n", ret); continue; } @@ -439,16 +439,15 @@ static int regulator_post_bind(struct udevice *dev) /* Regulator's mandatory constraint */ uc_pdata->name = dev_read_string(dev, property); if (!uc_pdata->name) { - debug("%s: dev '%s' has no property '%s'\n", - __func__, dev->name, property); + dev_dbg(dev, "has no property '%s'\n", property); uc_pdata->name = dev_read_name(dev); if (!uc_pdata->name) return -EINVAL; } if (!regulator_name_is_unique(dev, uc_pdata->name)) { - debug("'%s' of dev: '%s', has nonunique value: '%s\n", - property, dev->name, uc_pdata->name); + dev_dbg(dev, "'%s' has nonunique value: '%s\n", + property, uc_pdata->name); return -EINVAL; }