diff mbox series

of: __of_update_property_sysfs only call __of_sysfs_remove_bin_file if of_node_is_attached.

Message ID AM6PR04MB5239B08D03B4B4678818D41BFC030@AM6PR04MB5239.eurprd04.prod.outlook.com
State Superseded, archived
Headers show
Series of: __of_update_property_sysfs only call __of_sysfs_remove_bin_file if of_node_is_attached. | expand

Commit Message

Andre Kalb Sept. 4, 2018, 11:19 a.m. UTC
To prevent warning "kernfs: can not remove '(null)', no directory", if an overlay isn't applied to the active devicetree.

Using of_remove_property and than of_add_property don't show the warning.
---
 drivers/of/kobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.17.1
diff mbox series

Patch

diff --git a/drivers/of/kobj.c b/drivers/of/kobj.c index 7a0a18980b98..2b71e5979580 100644
--- a/drivers/of/kobj.c
+++ b/drivers/of/kobj.c
@@ -104,7 +104,7 @@  void __of_update_property_sysfs(struct device_node *np, struct property *newprop
                struct property *oldprop)
 {
        /* At early boot, bail out and defer setup to of_init() */
-       if (!of_kset)
+       if (!of_kset || !of_node_is_attached(np)))
                return;

        if (oldprop)