fix temp sensor detection with very new kernels

SVN revision: 63229
This commit is contained in:
Mike Blumenkrantz 2011-09-06 19:09:36 +00:00
parent e8b0436197
commit e580c44cbb
2 changed files with 20 additions and 9 deletions

View File

@ -250,16 +250,21 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype,
if (etype == EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR) /* ensure that temp input exists somewhere in this device chain */ if (etype == EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR) /* ensure that temp input exists somewhere in this device chain */
{ {
if (!_walk_parents_test_attr(device, "temp1_input", NULL)) Eina_Bool one, two;
goto out; const char *t;
one = _walk_parents_test_attr(device, "temp1_input", NULL);
two = _walk_parents_test_attr(device, "temp2_input", NULL);
if ((!one) && (!two)) goto out;
t = one ? "temp1_input" : "temp2_input";
/* if device is not the one which has the temp input, we must go up the chain */ /* if device is not the one which has the temp input, we must go up the chain */
if (!udev_device_get_sysattr_value(device, "temp1_input")) if (!udev_device_get_sysattr_value(device, t))
{ {
devname = NULL; devname = NULL;
for (parent = udev_device_get_parent(device); parent; parent = udev_device_get_parent(parent)) /*check for parent */ for (parent = udev_device_get_parent(device); parent; parent = udev_device_get_parent(parent)) /*check for parent */
if ((udev_device_get_sysattr_value(parent, "temp1_input"))) if ((udev_device_get_sysattr_value(parent, t)))
{ {
devname = udev_device_get_syspath(parent); devname = udev_device_get_syspath(parent);
break; break;

View File

@ -239,19 +239,25 @@ _get_syspath_from_watch(void *data,
break; break;
case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR: case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
{
Eina_Bool one, two;
const char *t;
#ifdef OLD_UDEV_RRRRRRRRRRRRRR #ifdef OLD_UDEV_RRRRRRRRRRRRRR
if ((!(test = udev_device_get_subsystem(device))) if ((!(test = udev_device_get_subsystem(device)))
|| (strcmp(test, "hwmon"))) || (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 (!_walk_parents_test_attr(device, "temp1_input", NULL)) one = _walk_parents_test_attr(device, "temp1_input", NULL);
goto error; two = _walk_parents_test_attr(device, "temp2_input", NULL);
if ((!one) && (!two)) goto error;
t = one ? "temp1_input" : "temp2_input";
/* if device is not the one which has the temp input, we must go up the chain */ /* if device is not the one which has the temp input, we must go up the chain */
if (!udev_device_get_sysattr_value(device, "temp1_input")) if (!udev_device_get_sysattr_value(device, t))
{ {
for (parent = udev_device_get_parent(device); parent; parent = udev_device_get_parent(parent)) /*check for parent */ for (parent = udev_device_get_parent(device); parent; parent = udev_device_get_parent(parent)) /*check for parent */
if (udev_device_get_sysattr_value(parent, "temp1_input")) if (udev_device_get_sysattr_value(parent, t))
{ {
tmpdev = device; tmpdev = device;
@ -264,7 +270,7 @@ _get_syspath_from_watch(void *data,
} }
break; break;
}
case EEZE_UDEV_TYPE_V4L: case EEZE_UDEV_TYPE_V4L:
if ((!(test = udev_device_get_subsystem(device))) if ((!(test = udev_device_get_subsystem(device)))
|| (strcmp(test, "video4linux"))) || (strcmp(test, "video4linux")))