aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-09-24 09:06:47 -0400
committerChris Michael <cp.michael@samsung.com>2014-09-24 09:06:47 -0400
commite3c3ba481127bcf03582794639f5b44dedece289 (patch)
tree1ad3b7325f39bb867da5ef4e8f39519beb5cac6a
parentelua: class unregister + keep track of Eo_Class (diff)
downloadefl-e3c3ba481127bcf03582794639f5b44dedece289.tar.gz
ecore-drm: Remove need to use an extra variable for storing device.
Summary: This commit just modifies the internal code to remove the need for an extra variable. There really is no need to store the device twice. We already have it in the list of returned devices. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 4b7c4e3017..2f7495d78d 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -153,7 +153,7 @@ ecore_drm_device_find(const char *name, const char *seat)
Ecore_Drm_Device *dev = NULL;
Eina_Bool found = EINA_FALSE;
Eina_List *devs, *l;
- const char *device, *tmpdevice;
+ const char *device;
/* try to get a list of drm devics */
if (!(devs = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRM, name)))
@@ -200,26 +200,19 @@ ecore_drm_device_find(const char *name, const char *seat)
cont:
eina_stringshare_del(devpath);
- if (found)
- {
- tmpdevice = eina_stringshare_add(device);
- break;
- }
+ if (found) break;
}
- EINA_LIST_FREE(devs, device)
- eina_stringshare_del(device);
-
- if (!found) return NULL;
+ if (!found) goto out;
if ((dev = calloc(1, sizeof(Ecore_Drm_Device))))
{
- dev->drm.name = eeze_udev_syspath_get_devpath(tmpdevice);
- dev->drm.path = eina_stringshare_add(tmpdevice);
+ dev->drm.name = eeze_udev_syspath_get_devpath(device);
+ dev->drm.path = eina_stringshare_add(device);
- dev->id = eeze_udev_syspath_get_sysnum(tmpdevice);
+ dev->id = eeze_udev_syspath_get_sysnum(device);
- dev->seat = eeze_udev_syspath_get_property(tmpdevice, "ID_SEAT");
+ dev->seat = eeze_udev_syspath_get_property(device, "ID_SEAT");
if (!dev->seat) dev->seat = eina_stringshare_add("seat0");
dev->format = 0;
@@ -228,7 +221,9 @@ cont:
DBG("Using Drm Device: %s", dev->drm.name);
}
- eina_stringshare_del(tmpdevice);
+out:
+ EINA_LIST_FREE(devs, device)
+ eina_stringshare_del(device);
return dev;
}