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)
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 7177b97..40dbf3a 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)
314 udev_enumerate_unref(en); 314 udev_enumerate_unref(en);
315 return ret; 315 return ret;
316} 316}
317
318EAPI int
319eeze_udev_syspath_get_sysnum(const char *syspath)
320{
321 _udev_device *device;
322 const char *test;
323 int ret = -1;
324
325 if (!syspath)
326 return NULL;
327
328 if (!(device = _new_device(syspath)))
329 return NULL;
330
331 if ((test = udev_device_get_sysnum(device)))
332 ret = atoi(test);
333
334 udev_device_unref(device);
335 return ret;
336}
337