summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-09-23 12:59:54 -0400
committerChris Michael <cp.michael@samsung.com>2014-09-23 13:01:14 -0400
commit25c3570294a6597af15e302bed54f3fc7ee7b9c7 (patch)
tree4754e489a82a888c59f551646c7458e3df373356
parent34ba873497ad6626a541c67d4ecbae5610057d71 (diff)
downloadefl-25c3570294a6597af15e302bed54f3fc7ee7b9c7.tar.gz
eeze: Add code for eeze_udev_syspath_get_sysnum function
Summary: This adds an API function to return the sysnum of a device based on syspath. This is needed in ecore-drm to return the id (sysnum) of a drm device. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/eeze/eeze_udev_syspath.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/eeze/eeze_udev_syspath.c b/src/lib/eeze/eeze_udev_syspath.c
index 7177b97472..40dbf3abe2 100644
--- a/src/lib/eeze/eeze_udev_syspath.c
+++ b/src/lib/eeze/eeze_udev_syspath.c
@@ -314,3 +314,24 @@ eeze_udev_devpath_get_syspath(const char *devpath)
udev_enumerate_unref(en);
return ret;
}
+
+EAPI int
+eeze_udev_syspath_get_sysnum(const char *syspath)
+{
+ _udev_device *device;
+ const char *test;
+ int ret = -1;
+
+ if (!syspath)
+ return NULL;
+
+ if (!(device = _new_device(syspath)))
+ return NULL;
+
+ if ((test = udev_device_get_sysnum(device)))
+ ret = atoi(test);
+
+ udev_device_unref(device);
+ return ret;
+}
+