staging: fsl-mc: implement uevent callback and set the modalias
authorStuart Yoder <stuart.yoder@nxp.com>
Wed, 22 Jun 2016 21:40:43 +0000 (16:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2016 00:14:03 +0000 (17:14 -0700)
Replace placeholder code in the uevent callback to properly
set the MODALIAS env variable.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/bus/mc-bus.c

index d8776dd89675911db7540fb3faa967b83c943e87..cf92a1cac28a432d76d74f17d08133be2731088f 100644 (file)
@@ -78,7 +78,13 @@ out:
  */
 static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
-       pr_debug("%s invoked\n", __func__);
+       struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
+
+       if (add_uevent_var(env, "MODALIAS=fsl-mc:v%08Xd%s",
+                          mc_dev->obj_desc.vendor,
+                          mc_dev->obj_desc.type))
+               return -ENOMEM;
+
        return 0;
 }