[rtems-libbsd commit] iicbus/rtems-i2c.c: Add rtems, path as an additional bus path

Christian Mauderer christianm at rtems.org
Thu Apr 22 16:53:19 UTC 2021


Module:    rtems-libbsd
Branch:    master
Commit:    5251e0c8164c5fbd01a5c6b4133373926f354eea
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=5251e0c8164c5fbd01a5c6b4133373926f354eea

Author:    G S Niteesh Babu <niteesh.gs at gmail.com>
Date:      Mon Apr 19 23:50:43 2021 +0530

iicbus/rtems-i2c.c: Add rtems,path as an additional bus path

Adds "rtems,path" as an additional bus path for the i2c driver.
Previously the bus path was provided in "rtems,i2c-path" property
only.

---

 rtemsbsd/sys/dev/iicbus/rtems-i2c.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/rtemsbsd/sys/dev/iicbus/rtems-i2c.c b/rtemsbsd/sys/dev/iicbus/rtems-i2c.c
index b965f24..0fb14d1 100644
--- a/rtemsbsd/sys/dev/iicbus/rtems-i2c.c
+++ b/rtemsbsd/sys/dev/iicbus/rtems-i2c.c
@@ -87,9 +87,11 @@ rtems_i2c_attach(device_t dev)
 
 	len = OF_getprop_alloc(node, "rtems,i2c-path", &sc->path);
 	if (len == -1){
-		device_printf(sc->dev, "Path not found in Device Tree");
-		OF_prop_free(sc->path);
-		return (ENXIO);
+		len = OF_getprop_alloc(node, "rtems,path", &sc->path);
+		if (len == -1) {
+			device_printf(sc->dev, "Path not found in Device Tree");
+			return (ENXIO);
+		}
 	}
 
 	if ((sc->sc_iicbus = device_add_child(sc->dev, "iicbus", -1)) == NULL) {



More information about the vc mailing list