greybus: core: add bundle id to bundle uevents
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 4 Dec 2015 09:44:24 +0000 (10:44 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 4 Dec 2015 23:37:59 +0000 (15:37 -0800)
Add the bundle id to bundle uevents.

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

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/core.c

index 4ec7988eea266998bebb70bcc8b73c38b8d1e2e3..209e1cd628380c139f3fe5a6fe35dc61c393676b 100644 (file)
@@ -112,7 +112,9 @@ static int greybus_uevent(struct device *dev, struct kobj_uevent_env *env)
                // add a uevent that can "load" a bundle type
                // This is what we need to bind a driver to so use the info
                // in gmod here as well
-               return 0;
+
+               if (add_uevent_var(env, "BUNDLE=%u", bundle->id))
+                       return -ENOMEM;
        }
 
        return 0;