diff options
author | Javier Martinez Canillas <martinez.javier@gmail.com> | 2010-12-06 01:40:22 +0100 |
---|---|---|
committer | Javier Martinez Canillas <martinez.javier@gmail.com> | 2010-12-06 01:40:22 +0100 |
commit | 2008c9fde6cc2e8f5f9c547c9f949b11396b9785 (patch) | |
tree | 751fc0a8b193050015208a5785f7c0989018fd78 | |
parent | 25be2026816327880d7d8ec7615e42374a70aef6 (diff) | |
download | ldd3-2008c9fde6cc2e8f5f9c547c9f949b11396b9785.tar.gz |
lddbus: update hotplug events to udev events
-rw-r--r-- | lddbus/lddbus.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lddbus/lddbus.c b/lddbus/lddbus.c index 7b469ad..0ad0090 100644 --- a/lddbus/lddbus.c +++ b/lddbus/lddbus.c @@ -28,16 +28,14 @@ MODULE_LICENSE("Dual BSD/GPL"); static char *Version = "$Revision: 1.9 $"; /* - * Respond to hotplug events. + * Respond to udev events. */ -static int ldd_hotplug(struct device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) +static int ldd_uevent(struct device *dev, struct kobj_uevent_env *env) { - envp[0] = buffer; - if (snprintf(buffer, buffer_size, "LDDBUS_VERSION=%s", - Version) >= buffer_size) + if (add_uevent_var(env, + "LDDBUS_VERSION=%s", Version)) return -ENOMEM; - envp[1] = NULL; + return 0; } @@ -69,7 +67,7 @@ struct device ldd_bus = { struct bus_type ldd_bus_type = { .name = "ldd", .match = ldd_match, - .hotplug = ldd_hotplug, + .uevent = ldd_uevent, }; /* |