summaryrefslogtreecommitdiffstats
path: root/drivers/of/base.c
diff options
context:
space:
mode:
authorStepan Moskovchenko <stepanm@codeaurora.org>2012-12-06 14:55:41 -0800
committerGrant Likely <grant.likely@secretlab.ca>2013-02-06 11:06:35 +0000
commitced4eec900850627409d7ff566b009471162b56b (patch)
treeeaa6551cbc421108d049e65855cdf618baa02117 /drivers/of/base.c
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
downloadlinux-ced4eec900850627409d7ff566b009471162b56b.tar.gz
linux-ced4eec900850627409d7ff566b009471162b56b.tar.xz
of: Output devicetree alias names in uevent
In some situations, userspace may want to resolve a device by function and logical number (ie, "serial0") rather than by the base address or full device path. Being able to resolve a device by alias frees userspace from the burden of otherwise having to maintain a mapping between device addresses and their logical assignments on each platform when multiple instances of the same hardware block are present in the system. Although the uevent device attribute contains devicetree compatible information and the full device path, the uevent does not list the alises that may have been defined for the device. Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org> [grant.likely: Removed OF_ALIAS_N field; I don't think it's needed] [grant.likely: Added #ifndef _LINUX_OF_PRIVATE_H wrapper] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 2390ddb22d60..d1bb50719ed7 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -24,33 +24,16 @@
#include <linux/slab.h>
#include <linux/proc_fs.h>
-/**
- * struct alias_prop - Alias property in 'aliases' node
- * @link: List node to link the structure in aliases_lookup list
- * @alias: Alias property name
- * @np: Pointer to device_node that the alias stands for
- * @id: Index value from end of alias name
- * @stem: Alias string without the index
- *
- * The structure represents one alias property of 'aliases' node as
- * an entry in aliases_lookup list.
- */
-struct alias_prop {
- struct list_head link;
- const char *alias;
- struct device_node *np;
- int id;
- char stem[0];
-};
+#include "of_private.h"
-static LIST_HEAD(aliases_lookup);
+LIST_HEAD(aliases_lookup);
struct device_node *of_allnodes;
EXPORT_SYMBOL(of_allnodes);
struct device_node *of_chosen;
struct device_node *of_aliases;
-static DEFINE_MUTEX(of_aliases_mutex);
+DEFINE_MUTEX(of_aliases_mutex);
/* use when traversing tree through the allnext, child, sibling,
* or parent members of struct device_node.