of: Disabling OF functions that use sysfs if CONFIG_SYSFS disabled
[deliverable/linux.git] / drivers / of / base.c
index bcfd08c2795c784c53e7f3778f13d503863ea905..7af64c48ca4213d8b48df374f523ba25a5a2c485 100644 (file)
@@ -138,6 +138,9 @@ int __of_add_property_sysfs(struct device_node *np, struct property *pp)
        /* Important: Don't leak passwords */
        bool secure = strncmp(pp->name, "security-", 9) == 0;
 
+       if (!IS_ENABLED(CONFIG_SYSFS))
+               return 0;
+
        if (!of_kset || !of_node_is_attached(np))
                return 0;
 
@@ -158,6 +161,9 @@ int __of_attach_node_sysfs(struct device_node *np)
        struct property *pp;
        int rc;
 
+       if (!IS_ENABLED(CONFIG_SYSFS))
+               return 0;
+
        if (!of_kset)
                return 0;
 
@@ -1713,6 +1719,9 @@ int __of_remove_property(struct device_node *np, struct property *prop)
 
 void __of_remove_property_sysfs(struct device_node *np, struct property *prop)
 {
+       if (!IS_ENABLED(CONFIG_SYSFS))
+               return;
+
        /* at early boot, bail here and defer setup to of_init() */
        if (of_kset && of_node_is_attached(np))
                sysfs_remove_bin_file(&np->kobj, &prop->attr);
@@ -1777,6 +1786,9 @@ int __of_update_property(struct device_node *np, struct property *newprop,
 void __of_update_property_sysfs(struct device_node *np, struct property *newprop,
                struct property *oldprop)
 {
+       if (!IS_ENABLED(CONFIG_SYSFS))
+               return;
+
        /* At early boot, bail out and defer setup to of_init() */
        if (!of_kset)
                return;
This page took 0.027837 seconds and 5 git commands to generate.