forked from enlightenment/efl
parent
8cc1f752d0
commit
683eafd4c8
|
@ -244,13 +244,24 @@ eeze_udev_find_by_type(const Eeze_Udev_Type etype, const char *name)
|
|||
device = udev_device_new_from_syspath(udev, devname);
|
||||
|
||||
if (etype == EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR)
|
||||
{
|
||||
parent = udev_device_get_parent(device);/*check for right subsystem*/
|
||||
if ((!(test = udev_device_get_subsystem(parent))) || (strcmp("platform", test)) ||
|
||||
/*check for a temp reading*/
|
||||
(!(test = udev_device_get_sysattr_value(parent, "temp1_input"))))
|
||||
{/* ensure that temp input exists somewhere in this device chain */
|
||||
if (!_walk_parents_for_attr(device, "temp1_input", NULL))
|
||||
goto out;
|
||||
/* if device is not the one which has the temp input, we must go up the chain */
|
||||
if (!(test = udev_device_get_sysattr_value(device, "temp1_input")))
|
||||
{
|
||||
devname = NULL;
|
||||
for (parent = udev_device_get_parent(device); parent; parent = udev_device_get_parent(parent))/*check for parent*/
|
||||
if (((test = udev_device_get_sysattr_value(parent, "temp1_input"))))
|
||||
{
|
||||
devname = udev_device_get_syspath(parent);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!devname)
|
||||
goto out;
|
||||
}
|
||||
|
||||
}
|
||||
if (name)
|
||||
if (!strstr(devname, name))
|
||||
|
|
|
@ -142,11 +142,22 @@ _get_syspath_from_watch(void *data, Ecore_Fd_Handler *fd_handler)
|
|||
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "hwmon")))
|
||||
goto error;
|
||||
#endif /* have to do stuff up here since we need info from the parent */
|
||||
if (!(parent = (udev_device_get_parent(device))) ||
|
||||
(!(test = (udev_device_get_subsystem(parent)))) ||
|
||||
(strcmp("platform", test)))
|
||||
if (!_walk_parents_for_attr(device, "temp1_input", NULL))
|
||||
goto error;
|
||||
if (!(test = udev_device_get_action(device)) || (!(ret = udev_device_get_syspath(parent))))
|
||||
/* if device is not the one which has the temp input, we must go up the chain */
|
||||
if (!(test = udev_device_get_sysattr_value(device, "temp1_input")))
|
||||
{
|
||||
tmpdev = NULL;
|
||||
for (parent = udev_device_get_parent(device); parent; parent = udev_device_get_parent(parent))/*check for parent*/
|
||||
if (((test = udev_device_get_sysattr_value(parent, "temp1_input"))))
|
||||
{
|
||||
tmpdev = parent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
tmpdev = device;
|
||||
if ((!tmpdev) || !(test = udev_device_get_action(device)) || (!(ret = udev_device_get_syspath(tmpdev))))
|
||||
goto error;
|
||||
|
||||
(*func)(eina_stringshare_add(ret), test, sdata, watch);
|
||||
|
|
Loading…
Reference in New Issue