return NULL;
if (!(device = _new_device(syspath)))
- return NULL;
+ {
+ udev_enumerate_unref(en);
+ return NULL;
+ }
vendor = udev_device_get_property_value(device, "ID_VENDOR_ID");
case EEZE_UDEV_TYPE_V4L:
udev_enumerate_add_match_subsystem(en, "video4linux");
break;
+
case EEZE_UDEV_TYPE_BLUETOOTH:
udev_enumerate_add_match_subsystem(en, "bluetooth");
break;
{
_udev_enumerate *en;
_udev_list_entry *devs, *cur;
- _udev_device *device;
const char *devname;
Eina_List *ret = NULL;
udev_list_entry_foreach(cur, devs)
{
devname = udev_list_entry_get_name(cur);
- device = udev_device_new_from_syspath(udev, devname);
- if (name)
- if (!strstr(devname, name))
- goto out;
+ if (name && (!strstr(devname, name)))
+ continue;
ret = eina_list_append(ret, eina_stringshare_add(devname));
-out:
- udev_device_unref(device);
}
udev_enumerate_unref(en);
return ret;
{
_udev_enumerate *en;
_udev_list_entry *devs, *cur;
- _udev_device *device;
const char *devname;
Eina_List *ret = NULL;
udev_list_entry_foreach(cur, devs)
{
devname = udev_list_entry_get_name(cur);
- device = udev_device_new_from_syspath(udev, devname);
ret = eina_list_append(ret, eina_stringshare_add(devname));
- udev_device_unref(device);
}
udev_enumerate_unref(en);
return ret;
{
_udev_enumerate *en;
_udev_list_entry *devs, *cur;
- _udev_device *device;
const char *devname;
Eina_List *ret = NULL;
- if (!sysname) return NULL;
-
en = udev_enumerate_new(udev);
if (!en) return NULL;
+ if (subsystem) udev_enumerate_add_match_subsystem(en, subsystem);
+ if (sysname) udev_enumerate_add_match_sysname(en, sysname);
+
udev_enumerate_scan_devices(en);
devs = udev_enumerate_get_list_entry(en);
udev_list_entry_foreach(cur, devs)
{
devname = udev_list_entry_get_name(cur);
- device =
- udev_device_new_from_subsystem_sysname(udev, subsystem, sysname);
ret = eina_list_append(ret, eina_stringshare_add(devname));
- udev_device_unref(device);
}
udev_enumerate_unref(en);
return ret;