All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg()
@ 2024-12-03 10:06 ` Patrice Chotard
  2024-12-03 10:06   ` [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind() Patrice Chotard
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Patrice Chotard @ 2024-12-03 10:06 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Jaehoon Chung,
	Jonas Karlman, Marek Vasut, Quentin Schulz, Simon Glass, Tom Rini

Replace some debug() by dev_dbg() when dev variable
is available/valid.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>

---

Changes in v2:
      - rework dev_dbg() message to avoid printing twice dev->name.

 drivers/power/regulator/regulator-uclass.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index decd0802c84..80ea5e65d48 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <dm.h>
 #include <log.h>
+#include <dm/device_compat.h>
 #include <dm/uclass-internal.h>
 #include <linux/delay.h>
 #include <power/pmic.h>
@@ -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;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind()
  2024-12-03 10:06 ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Patrice Chotard
@ 2024-12-03 10:06   ` Patrice Chotard
  2024-12-03 10:17     ` Quentin Schulz
  2024-12-03 23:47     ` Jaehoon Chung
  2024-12-03 10:17   ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Quentin Schulz
  2024-12-03 23:44   ` Jaehoon Chung
  2 siblings, 2 replies; 6+ messages in thread
From: Patrice Chotard @ 2024-12-03 10:06 UTC (permalink / raw)
  To: u-boot
  Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Jaehoon Chung,
	Jonas Karlman, Marek Vasut, Quentin Schulz, Simon Glass, Tom Rini

To ease debugging, use dev_err() instead of dev_dbg() for
alerting when regulator has nonunique value.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>

---

Changes in v2:
  - split initial patch into 2 commits to separate dev_dbg() and
    dev_err() migration.

 drivers/power/regulator/regulator-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 80ea5e65d48..09567eb9dbb 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -446,7 +446,7 @@ static int regulator_post_bind(struct udevice *dev)
 	}
 
 	if (!regulator_name_is_unique(dev, uc_pdata->name)) {
-		dev_dbg(dev, "'%s' has nonunique value: '%s\n",
+		dev_err(dev, "'%s' has nonunique value: '%s\n",
 			property, uc_pdata->name);
 		return -EINVAL;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg()
  2024-12-03 10:06 ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Patrice Chotard
  2024-12-03 10:06   ` [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind() Patrice Chotard
@ 2024-12-03 10:17   ` Quentin Schulz
  2024-12-03 23:44   ` Jaehoon Chung
  2 siblings, 0 replies; 6+ messages in thread
From: Quentin Schulz @ 2024-12-03 10:17 UTC (permalink / raw)
  To: Patrice Chotard, u-boot
  Cc: Patrick DELAUNAY, U-Boot STM32, Jaehoon Chung, Jonas Karlman,
	Marek Vasut, Simon Glass, Tom Rini

Hi Patrice,

On 12/3/24 11:06 AM, Patrice Chotard wrote:
> Replace some debug() by dev_dbg() when dev variable
> is available/valid.
> 
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> 

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind()
  2024-12-03 10:06   ` [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind() Patrice Chotard
@ 2024-12-03 10:17     ` Quentin Schulz
  2024-12-03 23:47     ` Jaehoon Chung
  1 sibling, 0 replies; 6+ messages in thread
From: Quentin Schulz @ 2024-12-03 10:17 UTC (permalink / raw)
  To: Patrice Chotard, u-boot
  Cc: Patrick DELAUNAY, U-Boot STM32, Jaehoon Chung, Jonas Karlman,
	Marek Vasut, Simon Glass, Tom Rini

Hi Patrice,

On 12/3/24 11:06 AM, Patrice Chotard wrote:
> To ease debugging, use dev_err() instead of dev_dbg() for
> alerting when regulator has nonunique value.
> 
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> 

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg()
  2024-12-03 10:06 ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Patrice Chotard
  2024-12-03 10:06   ` [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind() Patrice Chotard
  2024-12-03 10:17   ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Quentin Schulz
@ 2024-12-03 23:44   ` Jaehoon Chung
  2 siblings, 0 replies; 6+ messages in thread
From: Jaehoon Chung @ 2024-12-03 23:44 UTC (permalink / raw)
  To: 'Patrice Chotard', u-boot
  Cc: 'Patrick DELAUNAY', 'U-Boot STM32',
	'Jonas Karlman', 'Marek Vasut',
	'Quentin Schulz', 'Simon Glass',
	'Tom Rini'



> -----Original Message-----
> From: Patrice Chotard <patrice.chotard@foss.st.com>
> Sent: Tuesday, December 3, 2024 7:06 PM
> To: u-boot@lists.denx.de
> Cc: Patrice CHOTARD <patrice.chotard@foss.st.com>; Patrick DELAUNAY <patrick.delaunay@foss.st.com>; U-
> Boot STM32 <uboot-stm32@st-md-mailman.stormreply.com>; Jaehoon Chung <jh80.chung@samsung.com>; Jonas
> Karlman <jonas@kwiboo.se>; Marek Vasut <marex@denx.de>; Quentin Schulz <quentin.schulz@cherry.de>;
> Simon Glass <sjg@chromium.org>; Tom Rini <trini@konsulko.com>
> Subject: [PATCH v2 1/2] 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 <patrice.chotard@foss.st.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

>
> ---
>
> Changes in v2:
>       - rework dev_dbg() message to avoid printing twice dev->name.
>
>  drivers/power/regulator/regulator-uclass.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index decd0802c84..80ea5e65d48 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -9,6 +9,7 @@
>  #include <errno.h>
>  #include <dm.h>
>  #include <log.h>
> +#include <dm/device_compat.h>
>  #include <dm/uclass-internal.h>
>  #include <linux/delay.h>
>  #include <power/pmic.h>
> @@ -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;
>  	}
>
> --
> 2.25.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind()
  2024-12-03 10:06   ` [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind() Patrice Chotard
  2024-12-03 10:17     ` Quentin Schulz
@ 2024-12-03 23:47     ` Jaehoon Chung
  1 sibling, 0 replies; 6+ messages in thread
From: Jaehoon Chung @ 2024-12-03 23:47 UTC (permalink / raw)
  To: 'Patrice Chotard', u-boot
  Cc: 'Patrick DELAUNAY', 'U-Boot STM32',
	'Jonas Karlman', 'Marek Vasut',
	'Quentin Schulz', 'Simon Glass',
	'Tom Rini'



> -----Original Message-----
> From: Patrice Chotard <patrice.chotard@foss.st.com>
> Sent: Tuesday, December 3, 2024 7:06 PM
> To: u-boot@lists.denx.de
> Cc: Patrice CHOTARD <patrice.chotard@foss.st.com>; Patrick DELAUNAY <patrick.delaunay@foss.st.com>; U-
> Boot STM32 <uboot-stm32@st-md-mailman.stormreply.com>; Jaehoon Chung <jh80.chung@samsung.com>; Jonas
> Karlman <jonas@kwiboo.se>; Marek Vasut <marex@denx.de>; Quentin Schulz <quentin.schulz@cherry.de>;
> Simon Glass <sjg@chromium.org>; Tom Rini <trini@konsulko.com>
> Subject: [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind()
>
> To ease debugging, use dev_err() instead of dev_dbg() for
> alerting when regulator has nonunique value.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

>
> ---
>
> Changes in v2:
>   - split initial patch into 2 commits to separate dev_dbg() and
>     dev_err() migration.
>
>  drivers/power/regulator/regulator-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index 80ea5e65d48..09567eb9dbb 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -446,7 +446,7 @@ static int regulator_post_bind(struct udevice *dev)
>  	}
>
>  	if (!regulator_name_is_unique(dev, uc_pdata->name)) {
> -		dev_dbg(dev, "'%s' has nonunique value: '%s\n",
> +		dev_err(dev, "'%s' has nonunique value: '%s\n",
>  			property, uc_pdata->name);
>  		return -EINVAL;
>  	}
> --
> 2.25.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-03 23:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20241203101026epcas1p333452efbf04c91a651dc4de99877dbb8@epcas1p3.samsung.com>
2024-12-03 10:06 ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Patrice Chotard
2024-12-03 10:06   ` [PATCH v2 2/2] power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind() Patrice Chotard
2024-12-03 10:17     ` Quentin Schulz
2024-12-03 23:47     ` Jaehoon Chung
2024-12-03 10:17   ` [PATCH v2 1/2] power: regulator: replace some debug() by dev_dbg() Quentin Schulz
2024-12-03 23:44   ` Jaehoon Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.