From: Greg Kroah-Hartman Date: Tue, 12 Jan 2016 03:24:54 +0000 (-0800) Subject: greybus: uevent: add GREYBUS_ID to uevent X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de141314498b3e52cec7a0e5100e4dd278bde4c7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Viresh Kumar --- 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) {