greybus: core: add interface id to interface and bundle uevents
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 3 Dec 2015 18:18:04 +0000 (19:18 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 4 Dec 2015 01:25:28 +0000 (17:25 -0800)
Add the interface id to interface and bundle uevents.

This is needed to identify interfaces that are being removed (e.g. at
hot-unplug).

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/core.c

index 3d8b7ef..4ec7988 100644 (file)
@@ -102,6 +102,11 @@ static int greybus_uevent(struct device *dev, struct kobj_uevent_env *env)
        if (add_uevent_var(env, "BUS=%u", hd->bus_id))
                return -ENOMEM;
 
+       if (intf) {
+               if (add_uevent_var(env, "INTERFACE=%u", intf->interface_id))
+                       return -ENOMEM;
+       }
+
        if (bundle) {
                // FIXME
                // add a uevent that can "load" a bundle type