summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2016-01-11 19:24:54 -0800
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-13 15:24:33 -0800
commitde141314498b3e52cec7a0e5100e4dd278bde4c7 (patch)
tree8786227802c2b28d35c7565e2de925203088d811 /drivers/staging/greybus/core.c
parent14006ab2f53df868f3835ab0706b5ef94c90708f (diff)
greybus: uevent: add GREYBUS_ID to uevent
This adds the GREYBUS_ID environment variable to all interface uevents to let userspace know the vendor/product id of the module interface that has been added or removed from the system. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/staging/greybus/core.c')
-rw-r--r--drivers/staging/greybus/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index 6b31155d4a9c..0e2f99df6cfa 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -110,6 +110,10 @@ static int greybus_uevent(struct device *dev, struct kobj_uevent_env *env)
if (intf) {
if (add_uevent_var(env, "INTERFACE=%u", intf->interface_id))
return -ENOMEM;
+ if (add_uevent_var(env, "GREYBUS_ID=%04x/%04x",
+ (u16)(intf->vendor_id & 0xffff),
+ (u16)(intf->product_id & 0xffff)))
+ return -ENOMEM;
}
if (bundle) {