summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2015-05-19 15:02:15 +0200
committerKrzysztof Opasiak <k.opasiak@samsung.com>2015-05-19 15:03:24 +0200
commitb6afe061dff7bba9c59a8f43c85a1ac6855dcba1 (patch)
treefbf8b22f5afd459263713f59e9e28bb8a844c6c7
parent0553c45c78c6865a1b1e3386bbe686e0fffd9c87 (diff)
downloadlibusbg-b6afe061dff7bba9c59a8f43c85a1ac6855dcba1.tar.gz
libusbg-b6afe061dff7bba9c59a8f43c85a1ac6855dcba1.tar.bz2
libusbg-b6afe061dff7bba9c59a8f43c85a1ac6855dcba1.zip
libusbg: Allow to pass NULL as name to usbg_add_config_function()
Somtimes we would like to add function to configuration without any extraordinary name. In that case we can simply use type.instance as symlink name. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
-rw-r--r--src/usbg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/usbg.c b/src/usbg.c
index 61027e3..720da9a 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -2761,6 +2761,9 @@ int usbg_add_config_function(usbg_config *c, const char *name, usbg_function *f)
goto out;
}
+ if (!name)
+ name = f->name;
+
b = usbg_get_binding(c, name);
if (b) {
ERROR("duplicate binding name\n");