attempted fix for temp sensors #1

SVN revision: 49072
This commit is contained in:
Mike Blumenkrantz 2010-05-20 18:56:30 +00:00
parent 8cc1f752d0
commit 683eafd4c8
2 changed files with 33 additions and 11 deletions

View File

@ -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;
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 (!strstr(devname, name))

View File

@ -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)))
goto error;
if (!(test = udev_device_get_action(device)) || (!(ret = udev_device_get_syspath(parent))))
if (!_walk_parents_for_attr(device, "temp1_input", NULL))
goto error;
/* 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);