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);
|
device = udev_device_new_from_syspath(udev, devname);
|
||||||
|
|
||||||
if (etype == EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR)
|
if (etype == EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR)
|
||||||
{
|
{/* ensure that temp input exists somewhere in this device chain */
|
||||||
parent = udev_device_get_parent(device);/*check for right subsystem*/
|
if (!_walk_parents_for_attr(device, "temp1_input", NULL))
|
||||||
if ((!(test = udev_device_get_subsystem(parent))) || (strcmp("platform", test)) ||
|
|
||||||
/*check for a temp reading*/
|
|
||||||
(!(test = udev_device_get_sysattr_value(parent, "temp1_input"))))
|
|
||||||
goto out;
|
goto out;
|
||||||
devname = 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")))
|
||||||
|
{
|
||||||
|
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 (name)
|
||||||
if (!strstr(devname, 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")))
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "hwmon")))
|
||||||
goto error;
|
goto error;
|
||||||
#endif /* have to do stuff up here since we need info from the parent */
|
#endif /* have to do stuff up here since we need info from the parent */
|
||||||
if (!(parent = (udev_device_get_parent(device))) ||
|
if (!_walk_parents_for_attr(device, "temp1_input", NULL))
|
||||||
(!(test = (udev_device_get_subsystem(parent)))) ||
|
goto error;
|
||||||
(strcmp("platform", test)))
|
/* if device is not the one which has the temp input, we must go up the chain */
|
||||||
goto error;
|
if (!(test = udev_device_get_sysattr_value(device, "temp1_input")))
|
||||||
if (!(test = udev_device_get_action(device)) || (!(ret = udev_device_get_syspath(parent))))
|
{
|
||||||
|
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;
|
goto error;
|
||||||
|
|
||||||
(*func)(eina_stringshare_add(ret), test, sdata, watch);
|
(*func)(eina_stringshare_add(ret), test, sdata, watch);
|
||||||
|
|
Loading…
Reference in New Issue