All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe()
@ 2019-07-05 16:23 Bin Meng
  2019-07-05 16:23 ` [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode Bin Meng
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Bin Meng @ 2019-07-05 16:23 UTC (permalink / raw)
  To: u-boot

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 <bmeng.cn@gmail.com>
---

 drivers/timer/timer-uclass.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index 12ee6eb..97a4c74 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -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);
-- 
2.7.4

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

* [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
  2019-07-05 16:23 [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Bin Meng
@ 2019-07-05 16:23 ` Bin Meng
  2019-07-06 17:16   ` Simon Glass
  2019-07-21  1:50   ` sjg at google.com
  2019-07-05 16:23 ` [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node Bin Meng
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Bin Meng @ 2019-07-05 16:23 UTC (permalink / raw)
  To: u-boot

Without a valid ofnode, it's meaningless to call clk_set_defaults()
to process various properties.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/core/device.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index 0d15e50..37d89bc 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -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);
-- 
2.7.4

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

* [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node
  2019-07-05 16:23 [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Bin Meng
  2019-07-05 16:23 ` [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode Bin Meng
@ 2019-07-05 16:23 ` Bin Meng
  2019-07-06 17:16   ` Simon Glass
  2019-07-21  1:50   ` sjg at google.com
  2019-07-05 16:23 ` [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name() Bin Meng
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Bin Meng @ 2019-07-05 16:23 UTC (permalink / raw)
  To: u-boot

Per device tree spec, "status" property can have a value of "okay",
or "disabled", but not "disable".

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

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

diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index c72c6e2..bbea729 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -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");
 }
-- 
2.7.4

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

* [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name()
  2019-07-05 16:23 [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Bin Meng
  2019-07-05 16:23 ` [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode Bin Meng
  2019-07-05 16:23 ` [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node Bin Meng
@ 2019-07-05 16:23 ` Bin Meng
  2019-07-06 17:16   ` Simon Glass
  2019-07-21  1:50   ` sjg at google.com
  2019-07-06 17:16 ` [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Simon Glass
  2019-07-21  1:50 ` sjg at google.com
  4 siblings, 2 replies; 12+ messages in thread
From: Bin Meng @ 2019-07-05 16:23 UTC (permalink / raw)
  To: u-boot

The comments of dev_read_name() wrongly describe "node" as its
parameter.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 include/dm/read.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/dm/read.h b/include/dm/read.h
index 60b727c..ddb05d1 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -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);
-- 
2.7.4

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

* [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe()
  2019-07-05 16:23 [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Bin Meng
                   ` (2 preceding siblings ...)
  2019-07-05 16:23 ` [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name() Bin Meng
@ 2019-07-06 17:16 ` Simon Glass
  2019-07-21  1:50 ` sjg at google.com
  4 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2019-07-06 17:16 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> 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 <bmeng.cn@gmail.com>
> ---
>
>  drivers/timer/timer-uclass.c | 4 ++++
>  1 file changed, 4 insertions(+)

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

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

* [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
  2019-07-05 16:23 ` [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode Bin Meng
@ 2019-07-06 17:16   ` Simon Glass
  2019-07-21  1:50   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Glass @ 2019-07-06 17:16 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Without a valid ofnode, it's meaningless to call clk_set_defaults()
> to process various properties.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/core/device.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

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

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

* [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node
  2019-07-05 16:23 ` [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node Bin Meng
@ 2019-07-06 17:16   ` Simon Glass
  2019-07-21  1:50   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Glass @ 2019-07-06 17:16 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Per device tree spec, "status" property can have a value of "okay",
> or "disabled", but not "disable".
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/core/ofnode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

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

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

* [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name()
  2019-07-05 16:23 ` [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name() Bin Meng
@ 2019-07-06 17:16   ` Simon Glass
  2019-07-21  1:50   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Glass @ 2019-07-06 17:16 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> The comments of dev_read_name() wrongly describe "node" as its
> parameter.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  include/dm/read.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

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

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

* [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node
  2019-07-05 16:23 ` [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node Bin Meng
  2019-07-06 17:16   ` Simon Glass
@ 2019-07-21  1:50   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: sjg at google.com @ 2019-07-21  1:50 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Per device tree spec, "status" property can have a value of "okay",
> or "disabled", but not "disable".
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/core/ofnode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

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

Applied to u-boot-dm, thanks!

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

* [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name()
  2019-07-05 16:23 ` [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name() Bin Meng
  2019-07-06 17:16   ` Simon Glass
@ 2019-07-21  1:50   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: sjg at google.com @ 2019-07-21  1:50 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> The comments of dev_read_name() wrongly describe "node" as its
> parameter.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  include/dm/read.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

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

Applied to u-boot-dm, thanks!

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

* [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
  2019-07-05 16:23 ` [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode Bin Meng
  2019-07-06 17:16   ` Simon Glass
@ 2019-07-21  1:50   ` sjg at google.com
  1 sibling, 0 replies; 12+ messages in thread
From: sjg at google.com @ 2019-07-21  1:50 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Without a valid ofnode, it's meaningless to call clk_set_defaults()
> to process various properties.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/core/device.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

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

Applied to u-boot-dm, thanks!

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

* [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe()
  2019-07-05 16:23 [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Bin Meng
                   ` (3 preceding siblings ...)
  2019-07-06 17:16 ` [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Simon Glass
@ 2019-07-21  1:50 ` sjg at google.com
  4 siblings, 0 replies; 12+ messages in thread
From: sjg at google.com @ 2019-07-21  1:50 UTC (permalink / raw)
  To: u-boot

On Fri, 5 Jul 2019 at 10:23, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> 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 <bmeng.cn@gmail.com>
> ---
>
>  drivers/timer/timer-uclass.c | 4 ++++
>  1 file changed, 4 insertions(+)

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

Applied to u-boot-dm, thanks!

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

end of thread, other threads:[~2019-07-21  1:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05 16:23 [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Bin Meng
2019-07-05 16:23 ` [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode Bin Meng
2019-07-06 17:16   ` Simon Glass
2019-07-21  1:50   ` sjg at google.com
2019-07-05 16:23 ` [U-Boot] [PATCH 3/4] dm: core: Set correct "status" value for a node Bin Meng
2019-07-06 17:16   ` Simon Glass
2019-07-21  1:50   ` sjg at google.com
2019-07-05 16:23 ` [U-Boot] [PATCH 4/4] dm: Fix parameter description of dev_read_name() Bin Meng
2019-07-06 17:16   ` Simon Glass
2019-07-21  1:50   ` sjg at google.com
2019-07-06 17:16 ` [U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe() Simon Glass
2019-07-21  1:50 ` sjg at google.com

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.