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>
This commit is contained in:
committed by
Kristian Høgsberg
parent
d7488c2f5b
commit
6ac52db3b0
@@ -1396,20 +1396,18 @@ update_outputs(struct drm_compositor *ec, struct udev_device *drm_device)
|
|||||||
static int
|
static int
|
||||||
udev_event_is_hotplug(struct drm_compositor *ec, struct udev_device *device)
|
udev_event_is_hotplug(struct drm_compositor *ec, struct udev_device *device)
|
||||||
{
|
{
|
||||||
struct udev_list_entry *list, *hotplug_entry;
|
|
||||||
const char *sysnum;
|
const char *sysnum;
|
||||||
|
const char *val;
|
||||||
|
|
||||||
sysnum = udev_device_get_sysnum(device);
|
sysnum = udev_device_get_sysnum(device);
|
||||||
if (!sysnum || atoi(sysnum) != ec->drm.id)
|
if (!sysnum || atoi(sysnum) != ec->drm.id)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
list = udev_device_get_properties_list_entry(device);
|
val = udev_device_get_property_value(device, "HOTPLUG");
|
||||||
|
if (!val)
|
||||||
hotplug_entry = udev_list_entry_get_by_name(list, "HOTPLUG");
|
|
||||||
if (hotplug_entry == NULL)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return strcmp(udev_list_entry_get_value(hotplug_entry), "1") == 0;
|
return strcmp(val, "1") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
Reference in New Issue
Block a user