diff mbox series

[v2,06/45] sandbox: power: Update PMIC driver to use log

Message ID 20220907022733.66423-7-sjg@chromium.org
State Accepted
Commit 96d0c4514fdf3ec46c7fba718d4c8c84f51c6574
Delegated to: Tom Rini
Headers show
Series dm: core: Support multiple device trees in ofnode | expand

Commit Message

Simon Glass Sept. 7, 2022, 2:26 a.m. UTC
Use the log functions instead of pr_...() so we can avoid using __func__.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 drivers/power/pmic/sandbox.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Jaehoon Chung Sept. 8, 2022, 11:36 a.m. UTC | #1
On 9/7/22 11:26, Simon Glass wrote:
> Use the log functions instead of pr_...() so we can avoid using __func__.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

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

Best Regards,
Jaehoon Chung

> ---
> 
> (no changes since v1)
> 
>  drivers/power/pmic/sandbox.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/power/pmic/sandbox.c b/drivers/power/pmic/sandbox.c
> index d7870915de8..acfeae2df97 100644
> --- a/drivers/power/pmic/sandbox.c
> +++ b/drivers/power/pmic/sandbox.c
> @@ -4,11 +4,14 @@
>   *  Przemyslaw Marczak  <p.marczak@samsung.com>
>   */
>  
> +#define LOG_CATEGORY	UCLASS_PMIC
> +
>  #include <common.h>
>  #include <fdtdec.h>
>  #include <errno.h>
>  #include <dm.h>
>  #include <i2c.h>
> +#include <log.h>
>  #include <power/pmic.h>
>  #include <power/regulator.h>
>  #include <power/sandbox_pmic.h>
> @@ -28,7 +31,7 @@ static int sandbox_pmic_write(struct udevice *dev, uint reg,
>  			      const uint8_t *buff, int len)
>  {
>  	if (dm_i2c_write(dev, reg, buff, len)) {
> -		pr_err("write error to device: %p register: %#x!\n", dev, reg);
> +		log_err("write error to device: %p register: %#x!\n", dev, reg);
>  		return -EIO;
>  	}
>  
> @@ -39,7 +42,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg,
>  			     uint8_t *buff, int len)
>  {
>  	if (dm_i2c_read(dev, reg, buff, len)) {
> -		pr_err("read error from device: %p register: %#x!\n", dev, reg);
> +		log_err("read error from device: %p register: %#x!\n", dev, reg);
>  		return -EIO;
>  	}
>  
> @@ -49,8 +52,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg,
>  static int sandbox_pmic_bind(struct udevice *dev)
>  {
>  	if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info))
> -		pr_err("%s:%d PMIC: %s - no child found!", __func__, __LINE__,
> -							  dev->name);
> +		log_err("PMIC: %s - no child found!\n", dev->name);
>  
>  	/* Always return success for this device - allows for PMIC I/O */
>  	return 0;
diff mbox series

Patch

diff --git a/drivers/power/pmic/sandbox.c b/drivers/power/pmic/sandbox.c
index d7870915de8..acfeae2df97 100644
--- a/drivers/power/pmic/sandbox.c
+++ b/drivers/power/pmic/sandbox.c
@@ -4,11 +4,14 @@ 
  *  Przemyslaw Marczak  <p.marczak@samsung.com>
  */
 
+#define LOG_CATEGORY	UCLASS_PMIC
+
 #include <common.h>
 #include <fdtdec.h>
 #include <errno.h>
 #include <dm.h>
 #include <i2c.h>
+#include <log.h>
 #include <power/pmic.h>
 #include <power/regulator.h>
 #include <power/sandbox_pmic.h>
@@ -28,7 +31,7 @@  static int sandbox_pmic_write(struct udevice *dev, uint reg,
 			      const uint8_t *buff, int len)
 {
 	if (dm_i2c_write(dev, reg, buff, len)) {
-		pr_err("write error to device: %p register: %#x!\n", dev, reg);
+		log_err("write error to device: %p register: %#x!\n", dev, reg);
 		return -EIO;
 	}
 
@@ -39,7 +42,7 @@  static int sandbox_pmic_read(struct udevice *dev, uint reg,
 			     uint8_t *buff, int len)
 {
 	if (dm_i2c_read(dev, reg, buff, len)) {
-		pr_err("read error from device: %p register: %#x!\n", dev, reg);
+		log_err("read error from device: %p register: %#x!\n", dev, reg);
 		return -EIO;
 	}
 
@@ -49,8 +52,7 @@  static int sandbox_pmic_read(struct udevice *dev, uint reg,
 static int sandbox_pmic_bind(struct udevice *dev)
 {
 	if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info))
-		pr_err("%s:%d PMIC: %s - no child found!", __func__, __LINE__,
-							  dev->name);
+		log_err("PMIC: %s - no child found!\n", dev->name);
 
 	/* Always return success for this device - allows for PMIC I/O */
 	return 0;