diff options
Diffstat (limited to 'drivers/of')
| -rw-r--r-- | drivers/of/kobj.c | 2 | ||||
| -rw-r--r-- | drivers/of/unittest-data/tests-platform.dtsi | 10 | ||||
| -rw-r--r-- | drivers/of/unittest.c | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/drivers/of/kobj.c b/drivers/of/kobj.c index aa887166f0d2..1bb61a2c3399 100644 --- a/drivers/of/kobj.c +++ b/drivers/of/kobj.c @@ -77,7 +77,7 @@ int __of_add_property_sysfs(struct device_node *np, struct property *pp) pp->attr.attr.name = safe_name(&np->kobj, pp->name); pp->attr.attr.mode = secure ? 0400 : 0444; pp->attr.size = secure ? 0 : pp->length; - pp->attr.read_new = of_node_property_read; + pp->attr.read = of_node_property_read; rc = sysfs_create_bin_file(&np->kobj, &pp->attr); WARN(rc, "error adding attribute %s to node %pOF\n", pp->name, np); diff --git a/drivers/of/unittest-data/tests-platform.dtsi b/drivers/of/unittest-data/tests-platform.dtsi index 4171f43cf01c..59aa2a9731a7 100644 --- a/drivers/of/unittest-data/tests-platform.dtsi +++ b/drivers/of/unittest-data/tests-platform.dtsi @@ -37,6 +37,16 @@ test-device@2 { compatible = "test,rust-device"; reg = <0x2>; + + test,u32-prop = <0xdeadbeef>; + test,i16-array = /bits/ 16 <1 2 (-3) (-4)>; + + ref_child_0: child-0 { + test,ref-arg = <&ref_child_1 0x20 0x32>; + }; + ref_child_1: child-1 { + test,ref-arg = <&ref_child_0 0x10 0x64>; + }; }; }; diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index eeb370e0f507..e3503ec20f6c 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1856,6 +1856,8 @@ static void __init of_unittest_platform_populate(void) of_platform_populate(np, match, NULL, &test_bus->dev); for_each_child_of_node(np, child) { for_each_child_of_node(child, grandchild) { + if (!of_property_present(grandchild, "compatible")) + continue; pdev = of_find_device_by_node(grandchild); unittest(pdev, "Could not create device for node '%pOFn'\n", |