diff options
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r-- | drivers/of/device.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 4c74e4fc5a51..f685e55e0717 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -8,6 +8,7 @@ #include <linux/slab.h> #include <asm/errno.h> +#include "of_private.h" /** * of_match_device - Tell if a struct device matches an of_device_id list @@ -131,6 +132,7 @@ ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len) void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) { const char *compat; + struct alias_prop *app; int seen = 0, cplen, sl; if ((!dev) || (!dev->of_node)) @@ -153,6 +155,17 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) seen++; } add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen); + + seen = 0; + mutex_lock(&of_aliases_mutex); + list_for_each_entry(app, &aliases_lookup, link) { + if (dev->of_node == app->np) { + add_uevent_var(env, "OF_ALIAS_%d=%s", seen, + app->alias); + seen++; + } + } + mutex_unlock(&of_aliases_mutex); } int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) |