Re: [U-Boot] [PATCH v1 05/10] dm: core: gracefully handle alias seq without of

2020-06-30 Thread Tom Rini
On Mon, May 20, 2019 at 02:44:57AM +0200, Marcel Ziswiler wrote:

> Gracefully handle alias seq in the platform data rather than OF case.
> 
> Signed-off-by: Marcel Ziswiler 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH v1 05/10] dm: core: gracefully handle alias seq without of

2019-05-20 Thread Simon Glass
Hi Marcel,

On Sun, 19 May 2019 at 18:45, Marcel Ziswiler  wrote:
>
> Gracefully handle alias seq in the platform data rather than OF case.

I don't understand why this is needed or what it does.

Also if this is changing behaviour, then there should be a test for it.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 05/10] dm: core: gracefully handle alias seq without of

2019-05-19 Thread Marcel Ziswiler
Gracefully handle alias seq in the platform data rather than OF case.

Signed-off-by: Marcel Ziswiler 

---

 drivers/core/read.c | 4 +++-
 include/dm/read.h   | 4 
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/core/read.c b/drivers/core/read.c
index 6bda077a34..670ffe5dc5 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -212,15 +212,17 @@ int dev_read_alias_seq(struct udevice *dev, int *devnump)
 {
ofnode node = dev_ofnode(dev);
const char *uc_name = dev->uclass->uc_drv->name;
-   int ret;
+   int ret = -ENOTSUPP;
 
if (ofnode_is_np(node)) {
ret = of_alias_get_id(ofnode_to_np(node), uc_name);
if (ret >= 0)
*devnump = ret;
} else {
+#if CONFIG_IS_ENABLED(OF_CONTROL)
ret = fdtdec_get_alias_seq(gd->fdt_blob, uc_name,
   ofnode_to_offset(node), devnump);
+#endif
}
 
return ret;
diff --git a/include/dm/read.h b/include/dm/read.h
index 60b727cbd8..a8ffbe42ac 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -702,8 +702,12 @@ static inline const void *dev_read_prop(struct udevice 
*dev,
 
 static inline int dev_read_alias_seq(struct udevice *dev, int *devnump)
 {
+#if CONFIG_IS_ENABLED(OF_CONTROL)
return fdtdec_get_alias_seq(gd->fdt_blob, dev->uclass->uc_drv->name,
dev_of_offset(dev), devnump);
+#else
+   return -ENOTSUPP;
+#endif
 }
 
 static inline int dev_read_u32_array(struct udevice *dev, const char *propname,
-- 
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot