diff mbox series

[v2,01/46] dm: syscon: Fix calling dev_dbg with an uninitialized device

Message ID 20200915144522.509493-2-seanga2@gmail.com
State Accepted
Commit 46df2f87bd9697a49b49f53d54a9e39da0684a7d
Delegated to: Tom Rini
Headers show
Series dm: Print device name in dev_xxx like Linux | expand

Commit Message

Sean Anderson Sept. 15, 2020, 2:44 p.m. UTC
We can't use dev_dbg here because we haven't bound to the device yet. Use
log_debug instead.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

Changes in v2:
- New

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

Comments

Patrick DELAUNAY Sept. 16, 2020, 12:44 p.m. UTC | #1
Hi Sean,

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Sean Anderson
> Sent: mardi 15 septembre 2020 16:45
> 
> We can't use dev_dbg here because we haven't bound to the device yet. Use
> log_debug instead.
> 
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
> 
> Changes in v2:
> - New
> 
>  drivers/core/syscon-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c index
> b5cd763b6b..453933f59e 100644
> --- a/drivers/core/syscon-uclass.c
> +++ b/drivers/core/syscon-uclass.c
> @@ -66,7 +66,7 @@ static int syscon_probe_by_ofnode(ofnode node, struct
> udevice **devp)
> 
>  	/* found node with "syscon" compatible, not bounded to SYSCON
> UCLASS */
>  	if (!ofnode_device_is_compatible(node, "syscon")) {
> -		dev_dbg(dev, "invalid compatible for syscon device\n");
> +		log_debug("invalid compatible for syscon device\n");
>  		return -EINVAL;
>  	}
> 
> --
> 2.28.0

As log API is used, the category could be indicated at the beginning of the files...
before ' #include <log.h>'

+ #define LOG_CATEGORY UCLASS_SYSCON
+
#include <common.h>
#include <log.h>

Anyway

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>

Thanks

Patrick
Sean Anderson Sept. 16, 2020, 12:51 p.m. UTC | #2
On 9/16/20 8:44 AM, Patrick DELAUNAY wrote:
> Hi Sean,
> 
>> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Sean Anderson
>> Sent: mardi 15 septembre 2020 16:45
>>
>> We can't use dev_dbg here because we haven't bound to the device yet. Use
>> log_debug instead.
>>
>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>> ---
>>
>> Changes in v2:
>> - New
>>
>>  drivers/core/syscon-uclass.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c index
>> b5cd763b6b..453933f59e 100644
>> --- a/drivers/core/syscon-uclass.c
>> +++ b/drivers/core/syscon-uclass.c
>> @@ -66,7 +66,7 @@ static int syscon_probe_by_ofnode(ofnode node, struct
>> udevice **devp)
>>
>>  	/* found node with "syscon" compatible, not bounded to SYSCON
>> UCLASS */
>>  	if (!ofnode_device_is_compatible(node, "syscon")) {
>> -		dev_dbg(dev, "invalid compatible for syscon device\n");
>> +		log_debug("invalid compatible for syscon device\n");
>>  		return -EINVAL;
>>  	}
>>
>> --
>> 2.28.0
> 
> As log API is used, the category could be indicated at the beginning of the files...
> before ' #include <log.h>'
> 
> + #define LOG_CATEGORY UCLASS_SYSCON
> +
> #include <common.h>
> #include <log.h>

Sure, I will include that in v3.

> Anyway
> 
> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
> 
> Thanks
> 
> Patrick
>
diff mbox series

Patch

diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c
index b5cd763b6b..453933f59e 100644
--- a/drivers/core/syscon-uclass.c
+++ b/drivers/core/syscon-uclass.c
@@ -66,7 +66,7 @@  static int syscon_probe_by_ofnode(ofnode node, struct udevice **devp)
 
 	/* found node with "syscon" compatible, not bounded to SYSCON UCLASS */
 	if (!ofnode_device_is_compatible(node, "syscon")) {
-		dev_dbg(dev, "invalid compatible for syscon device\n");
+		log_debug("invalid compatible for syscon device\n");
 		return -EINVAL;
 	}