All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reboot-mode: migrate uclass to livetree
@ 2021-09-20 16:27 Patrick Delaunay
  2021-09-21  1:11 ` Simon Glass
  2021-10-05 22:02 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick Delaunay @ 2021-09-20 16:27 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Nandor Han, Simon Glass, U-Boot STM32

Use dev_ function to support a live tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

 drivers/reboot-mode/reboot-mode-uclass.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/reboot-mode/reboot-mode-uclass.c b/drivers/reboot-mode/reboot-mode-uclass.c
index bb7a355fbf..2b38aa26b8 100644
--- a/drivers/reboot-mode/reboot-mode-uclass.c
+++ b/drivers/reboot-mode/reboot-mode-uclass.c
@@ -10,8 +10,6 @@
 #include <exports.h>
 #include <reboot-mode/reboot-mode.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 int dm_reboot_mode_update(struct udevice *dev)
 {
 	struct reboot_mode_ops *ops = reboot_mode_get_ops(dev);
@@ -66,25 +64,20 @@ int dm_reboot_mode_pre_probe(struct udevice *dev)
 		return -EINVAL;
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
-	const int node = dev_of_offset(dev);
 	const char *mode_prefix = "mode-";
 	const int mode_prefix_len = strlen(mode_prefix);
-	int property;
+	struct ofprop property;
 	const u32 *propvalue;
 	const char *propname;
 
-	plat_data->env_variable = fdt_getprop(gd->fdt_blob,
-					      node,
-					      "u-boot,env-variable",
-					      NULL);
+	plat_data->env_variable = dev_read_string(dev, "u-boot,env-variable");
 	if (!plat_data->env_variable)
 		plat_data->env_variable = "reboot-mode";
 
 	plat_data->count = 0;
 
-	fdt_for_each_property_offset(property, gd->fdt_blob, node) {
-		propvalue = fdt_getprop_by_offset(gd->fdt_blob,
-						  property, &propname, NULL);
+	dev_for_each_property(property, dev) {
+		propvalue = dev_read_prop_by_prop(&property, &propname, NULL);
 		if (!propvalue) {
 			dev_err(dev, "Could not get the value for property %s\n",
 				propname);
@@ -100,9 +93,8 @@ int dm_reboot_mode_pre_probe(struct udevice *dev)
 
 	struct reboot_mode_mode *next = plat_data->modes;
 
-	fdt_for_each_property_offset(property, gd->fdt_blob, node) {
-		propvalue = fdt_getprop_by_offset(gd->fdt_blob,
-						  property, &propname, NULL);
+	dev_for_each_property(property, dev) {
+		propvalue = dev_read_prop_by_prop(&property, &propname, NULL);
 		if (!propvalue) {
 			dev_err(dev, "Could not get the value for property %s\n",
 				propname);
-- 
2.25.1


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

* Re: [PATCH] reboot-mode: migrate uclass to livetree
  2021-09-20 16:27 [PATCH] reboot-mode: migrate uclass to livetree Patrick Delaunay
@ 2021-09-21  1:11 ` Simon Glass
  2021-10-05 22:02 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-09-21  1:11 UTC (permalink / raw)
  To: Patrick Delaunay; +Cc: U-Boot Mailing List, Nandor Han, U-Boot STM32

On Mon, 20 Sept 2021 at 10:27, Patrick Delaunay
<patrick.delaunay@foss.st.com> wrote:
>
> Use dev_ function to support a live tree.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
>  drivers/reboot-mode/reboot-mode-uclass.c | 20 ++++++--------------
>  1 file changed, 6 insertions(+), 14 deletions(-)

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

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

* Re: [PATCH] reboot-mode: migrate uclass to livetree
  2021-09-20 16:27 [PATCH] reboot-mode: migrate uclass to livetree Patrick Delaunay
  2021-09-21  1:11 ` Simon Glass
@ 2021-10-05 22:02 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-10-05 22:02 UTC (permalink / raw)
  To: Patrick Delaunay; +Cc: u-boot, Nandor Han, Simon Glass, U-Boot STM32

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

On Mon, Sep 20, 2021 at 06:27:20PM +0200, Patrick Delaunay wrote:

> Use dev_ function to support a live tree.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2021-10-05 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 16:27 [PATCH] reboot-mode: migrate uclass to livetree Patrick Delaunay
2021-09-21  1:11 ` Simon Glass
2021-10-05 22:02 ` Tom Rini

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.