mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-26 12:00:39 +08:00
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.
This commit is contained in:
parent
829afafbcb
commit
5251e0c816
@ -86,11 +86,13 @@ rtems_i2c_attach(device_t dev)
|
|||||||
node = ofw_bus_get_node(sc->dev);
|
node = ofw_bus_get_node(sc->dev);
|
||||||
|
|
||||||
len = OF_getprop_alloc(node, "rtems,i2c-path", &sc->path);
|
len = OF_getprop_alloc(node, "rtems,i2c-path", &sc->path);
|
||||||
|
if (len == -1){
|
||||||
|
len = OF_getprop_alloc(node, "rtems,path", &sc->path);
|
||||||
if (len == -1) {
|
if (len == -1) {
|
||||||
device_printf(sc->dev, "Path not found in Device Tree");
|
device_printf(sc->dev, "Path not found in Device Tree");
|
||||||
OF_prop_free(sc->path);
|
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((sc->sc_iicbus = device_add_child(sc->dev, "iicbus", -1)) == NULL) {
|
if ((sc->sc_iicbus = device_add_child(sc->dev, "iicbus", -1)) == NULL) {
|
||||||
device_printf(sc->dev, "could not allocate iicbus instance\n");
|
device_printf(sc->dev, "could not allocate iicbus instance\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user