summaryrefslogtreecommitdiffstats
path: root/drivers/slimbus
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2018-09-17 01:45:40 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-25 20:21:02 +0200
commit9e663f4811c6fd58c03e918c3f0a2e08810e38c1 (patch)
tree85c1b8b331990dacbf621d06b539bdf1ee380cc3 /drivers/slimbus
parentslimbus: core: update device status in probe (diff)
downloadlinux-9e663f4811c6fd58c03e918c3f0a2e08810e38c1.tar.xz
linux-9e663f4811c6fd58c03e918c3f0a2e08810e38c1.zip
slimbus: core: add support to uevent
This patch adds support to uevent to help automatic module loading. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/slimbus')
-rw-r--r--drivers/slimbus/core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 1888fafc0e73..55eda5863a6b 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -9,6 +9,7 @@
#include <linux/init.h>
#include <linux/idr.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/pm_runtime.h>
#include <linux/slimbus.h>
#include "slimbus.h"
@@ -76,11 +77,24 @@ static int slim_device_remove(struct device *dev)
return 0;
}
+static int slim_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ struct slim_device *sbdev = to_slim_device(dev);
+ int ret;
+
+ ret = of_device_uevent_modalias(dev, env);
+ if (ret != -ENODEV)
+ return ret;
+
+ return add_uevent_var(env, "MODALIAS=slim:%s", dev_name(&sbdev->dev));
+}
+
struct bus_type slimbus_bus = {
.name = "slimbus",
.match = slim_device_match,
.probe = slim_device_probe,
.remove = slim_device_remove,
+ .uevent = slim_device_uevent,
};
EXPORT_SYMBOL_GPL(slimbus_bus);