* [PATCH] demo: migrate uclass to livetree
@ 2021-09-20 15:58 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 15:58 UTC (permalink / raw)
To: u-boot; +Cc: Patrick Delaunay, Simon Glass, U-Boot STM32
Use dev_ function to read the sides and colour to support a live tree.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---
drivers/demo/demo-uclass.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/demo/demo-uclass.c b/drivers/demo/demo-uclass.c
index 815f8de645..09f9a47d4d 100644
--- a/drivers/demo/demo-uclass.c
+++ b/drivers/demo/demo-uclass.c
@@ -10,15 +10,11 @@
#include <dm.h>
#include <dm-demo.h>
#include <errno.h>
-#include <fdtdec.h>
#include <log.h>
#include <malloc.h>
-#include <asm/global_data.h>
#include <asm/io.h>
#include <linux/list.h>
-DECLARE_GLOBAL_DATA_PTR;
-
UCLASS_DRIVER(demo) = {
.name = "demo",
.id = UCLASS_DEMO,
@@ -67,10 +63,9 @@ int demo_set_light(struct udevice *dev, int light)
int demo_parse_dt(struct udevice *dev)
{
struct dm_demo_pdata *pdata = dev_get_plat(dev);
- int dn = dev_of_offset(dev);
- pdata->sides = fdtdec_get_int(gd->fdt_blob, dn, "sides", 0);
- pdata->colour = fdt_getprop(gd->fdt_blob, dn, "colour", NULL);
+ pdata->sides = dev_read_s32_default(dev, "sides", 0);
+ pdata->colour = dev_read_string(dev, "colour");
if (!pdata->sides || !pdata->colour) {
debug("%s: Invalid device tree data\n", __func__);
return -EINVAL;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] demo: migrate uclass to livetree
2021-09-20 15:58 [PATCH] demo: 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, U-Boot STM32
On Mon, 20 Sept 2021 at 09:58, Patrick Delaunay
<patrick.delaunay@foss.st.com> wrote:
>
> Use dev_ function to read the sides and colour to support a live tree.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
> drivers/demo/demo-uclass.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] demo: migrate uclass to livetree
2021-09-20 15:58 [PATCH] demo: 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, Simon Glass, U-Boot STM32
[-- Attachment #1: Type: text/plain, Size: 309 bytes --]
On Mon, Sep 20, 2021 at 05:58:33PM +0200, Patrick Delaunay wrote:
> Use dev_ function to read the sides and colour 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 15:58 [PATCH] demo: 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.