dm: timer: Skip device that does not have a valid ofnode in pre_probe()
PATCH 1/4 dm: timer: Skip device that does not have a valid ofnode in pre_probe()
It is possible that a timer device has a null ofnode, hence there is no need to further parse DT for the clock rate.
---
drivers/timer/timer-uclass.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/timer/timer-uclass.c +4 -0
@@ -48,6 +48,10 @@ static int timer_pre_probe(struct udevice *dev)int err;ulong ret; +/* It is possible that a timer device has a null ofnode */ +if (!dev_of_valid (dev)) +return 0 ; + err =clk_get_by_index (dev,0 , &timer_clk);if (!err) { ret =clk_get_rate (&timer_clk);
Signature · 1 line
2.7.4
PATCH 2/4 dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
Without a valid ofnode, it's meaningless to call clk_set_defaults() to process various properties.
---
drivers/core/device.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/core/device.c +10 -4
@@ -409,10 +409,16 @@ int device_probe(struct udevice *dev) goto fail; } -/* Process 'assigned-{clocks/clock-parents/clock-rates}' properties */ - ret =clk_set_defaults (dev); -if (ret) - goto fail; +/* Only handle devices that have a valid ofnode */ +if (dev_of_valid (dev)) { +/* +* Process 'assigned-{clocks/clock-parents/clock-rates}' +* properties +*/ + ret =clk_set_defaults (dev); +if (ret) + goto fail; + }if (drv->probe) { ret = drv->probe (dev);
Signature · 1 line
2.7.4
PATCH 2/4 dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
Quoted 9 lines · Bin Meng
Without a valid ofnode, it's meaningless to call
clk_set_defaults()to process various properties.Signed-off-by Bin Meng <[email protected]>---
drivers/core/device.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
PATCH 2/4 dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
Quoted 9 lines · Bin Meng
Without a valid ofnode, it's meaningless to call
clk_set_defaults()to process various properties.Signed-off-by Bin Meng <[email protected]>---
drivers/core/device.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
Applied to u-boot-dm, thanks!
PATCH 3/4 dm: core: Set correct "status" value for a node
In reply to Bin MengPer device tree spec, "status" property can have a value of "okay", or "disabled", but not "disable".
---
drivers/core/ofnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/core/ofnode.c +1 -1
@@ -876,5 +876,5 @@ int ofnode_set_enabled(ofnode node, bool value)if (value)return ofnode_write_string (node,"status" ,"okay" );else -return ofnode_write_string (node,"status" ,"disable" ); +return ofnode_write_string (node,"status" ,"disabled" ); }
Signature · 1 line
2.7.4
PATCH 3/4 dm: core: Set correct "status" value for a node
Quoted 10 lines · Bin Meng
Per device tree spec, "status" property can have a value of "okay", or "disabled", but not "disable".
Signed-off-by Bin Meng <[email protected]>---
drivers/core/ofnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 3/4 dm: core: Set correct "status" value for a node
Quoted 10 lines · Bin Meng
Per device tree spec, "status" property can have a value of "okay", or "disabled", but not "disable".
Signed-off-by Bin Meng <[email protected]>---
drivers/core/ofnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH 4/4 dm: Fix parameter description of dev_read_name()
In reply to Bin MengThe comments of dev_read_name() wrongly describe "node" as its parameter.
---
include/dm/read.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/dm/read.h +1 -1
@@ -227,7 +227,7 @@ fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *propname,/** * dev_read_name() - get the name of a device's node * -* @node: valid node to look up +* @dev: Device to read from * @return name of node */ const char *dev_read_name (struct udevice *dev);
Signature · 1 line
2.7.4
PATCH 4/4 dm: Fix parameter description of dev_read_name()
Quoted 10 lines · Bin Meng
The comments of
dev_read_name()wrongly describe "node" as its parameter.Signed-off-by Bin Meng <[email protected]>---
include/dm/read.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 4/4 dm: Fix parameter description of dev_read_name()
Quoted 10 lines · Bin Meng
The comments of
dev_read_name()wrongly describe "node" as its parameter.Signed-off-by Bin Meng <[email protected]>---
include/dm/read.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH 1/4 dm: timer: Skip device that does not have a valid ofnode in pre_probe()
In reply to Bin MengQuoted 9 lines · Bin Meng
It is possible that a timer device has a null ofnode, hence there is no need to further parse DT for the clock rate.
Signed-off-by Bin Meng <[email protected]>---
drivers/timer/timer-uclass.c | 4 ++++ 1 file changed, 4 insertions(+)
PATCH 1/4 dm: timer: Skip device that does not have a valid ofnode in pre_probe()
Quoted 9 lines · Bin Meng
It is possible that a timer device has a null ofnode, hence there is no need to further parse DT for the clock rate.
Signed-off-by Bin Meng <[email protected]>---
drivers/timer/timer-uclass.c | 4 ++++ 1 file changed, 4 insertions(+)
Applied to u-boot-dm, thanks!