summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-03-11 20:05:22 +0100
committerKristian Høgsberg <krh@bitplanet.net>2012-03-11 15:55:32 -0400
commit6ac52db3b0069adddf58c1ec3a120e5d09d9104b (patch)
tree6d57665672ddafd00e647777964340427a455f47
parentd7488c2f5b3832a668dacb13e9a74a000af927a8 (diff)
compositor-drm: use udev_device_get_property_value() helper
Udev provides a convenient helper. Use it instead of working with the property-list directly. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
-rw-r--r--src/compositor-drm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 27d4512..ba376eb 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1396,20 +1396,18 @@ update_outputs(struct drm_compositor *ec, struct udev_device *drm_device)
static int
udev_event_is_hotplug(struct drm_compositor *ec, struct udev_device *device)
{
- struct udev_list_entry *list, *hotplug_entry;
const char *sysnum;
+ const char *val;
sysnum = udev_device_get_sysnum(device);
if (!sysnum || atoi(sysnum) != ec->drm.id)
return 0;
- list = udev_device_get_properties_list_entry(device);
-
- hotplug_entry = udev_list_entry_get_by_name(list, "HOTPLUG");
- if (hotplug_entry == NULL)
+ val = udev_device_get_property_value(device, "HOTPLUG");
+ if (!val)
return 0;
- return strcmp(udev_list_entry_get_value(hotplug_entry), "1") == 0;
+ return strcmp(val, "1") == 0;
}
static int