of: rename of_aliases_mutex to just of_mutex
authorPantelis Antoniou <pantelis.antoniou@konsulko.com>
Fri, 4 Jul 2014 16:58:03 +0000 (19:58 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 16 Feb 2015 05:47:27 +0000 (14:47 +0900)
We're overloading usage of of_aliases_mutex for sysfs changes,
so rename to something that is more generic.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit c05aba2bd5f9dd3f363611ff844513de1341ac60)
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/of/base.c
drivers/of/device.c
drivers/of/of_private.h

index ccf94f814144aab42cab255f8fb3da9f91eef8ee..b0b29f9f42ebe225286e287823bea5b412508555 100644 (file)
@@ -38,10 +38,9 @@ static struct device_node *of_stdout;
 static struct kset *of_kset;
 
 /*
- * Used to protect the of_aliases; but also overloaded to hold off addition of
- * nodes to sysfs
+ * Used to protect the of_aliases, to hold off addition of nodes to sysfs
  */
-DEFINE_MUTEX(of_aliases_mutex);
+DEFINE_MUTEX(of_mutex);
 
 /* use when traversing tree through the allnext, child, sibling,
  * or parent members of struct device_node.
@@ -173,13 +172,13 @@ int of_node_add(struct device_node *np)
         * Grab the mutex here so that in a race condition between of_init() and
         * of_node_add(), node addition will still be consistent.
         */
-       mutex_lock(&of_aliases_mutex);
+       mutex_lock(&of_mutex);
        if (of_kset)
                rc = __of_node_add(np);
        else
                /* This scenario may be perfectly valid, but report it anyway */
                pr_info("of_node_add(%s) before of_init()\n", np->full_name);
-       mutex_unlock(&of_aliases_mutex);
+       mutex_unlock(&of_mutex);
        return rc;
 }
 
@@ -188,15 +187,15 @@ static int __init of_init(void)
        struct device_node *np;
 
        /* Create the kset, and register existing nodes */
-       mutex_lock(&of_aliases_mutex);
+       mutex_lock(&of_mutex);
        of_kset = kset_create_and_add("devicetree", NULL, firmware_kobj);
        if (!of_kset) {
-               mutex_unlock(&of_aliases_mutex);
+               mutex_unlock(&of_mutex);
                return -ENOMEM;
        }
        for_each_of_allnodes(np)
                __of_node_add(np);
-       mutex_unlock(&of_aliases_mutex);
+       mutex_unlock(&of_mutex);
 
        /* Symlink in /proc as required by userspace ABI */
        if (of_allnodes)
@@ -1669,7 +1668,7 @@ int of_alias_get_id(struct device_node *np, const char *stem)
        struct alias_prop *app;
        int id = -ENODEV;
 
-       mutex_lock(&of_aliases_mutex);
+       mutex_lock(&of_mutex);
        list_for_each_entry(app, &aliases_lookup, link) {
                if (strcmp(app->stem, stem) != 0)
                        continue;
@@ -1679,7 +1678,7 @@ int of_alias_get_id(struct device_node *np, const char *stem)
                        break;
                }
        }
-       mutex_unlock(&of_aliases_mutex);
+       mutex_unlock(&of_mutex);
 
        return id;
 }
index f685e55e0717f611bf479f95d790675d6bb77bf5..4f942b56fab95d117eb7c2aff94f3e8528361032 100644 (file)
@@ -157,7 +157,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
        add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen);
 
        seen = 0;
-       mutex_lock(&of_aliases_mutex);
+       mutex_lock(&of_mutex);
        list_for_each_entry(app, &aliases_lookup, link) {
                if (dev->of_node == app->np) {
                        add_uevent_var(env, "OF_ALIAS_%d=%s", seen,
@@ -165,7 +165,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
                        seen++;
                }
        }
-       mutex_unlock(&of_aliases_mutex);
+       mutex_unlock(&of_mutex);
 }
 
 int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env)
index 0384f097bcc845f5fcc4e67988bbf4e9e7dc11d2..0f6089722af96480a5e97d0834512c549249e8a6 100644 (file)
@@ -31,7 +31,7 @@ struct alias_prop {
        char stem[0];
 };
 
-extern struct mutex of_aliases_mutex;
+extern struct mutex of_mutex;
 extern struct list_head aliases_lookup;
 
 static inline struct device_node *kobj_to_device_node(struct kobject *kobj)