Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262284
b: refs/heads/master
c: 0d97d7a
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Len Brown committed Aug 2, 2011
1 parent 0885fd6 commit ed959bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab92402af04c151c26541eb28e1c26286a429db5
refs/heads/master: 0d97d7a494d43be77f57e688369be0aae33d1ade
25 changes: 19 additions & 6 deletions trunk/drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,22 +469,35 @@ temp_crit_show(struct device *dev, struct device_attribute *attr,
}


static int
thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
static struct thermal_hwmon_device *
thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz)
{
struct thermal_hwmon_device *hwmon;
int new_hwmon_device = 1;
int result;

mutex_lock(&thermal_list_lock);
list_for_each_entry(hwmon, &thermal_hwmon_list, node)
if (!strcmp(hwmon->type, tz->type)) {
new_hwmon_device = 0;
mutex_unlock(&thermal_list_lock);
goto register_sys_interface;
return hwmon;
}
mutex_unlock(&thermal_list_lock);

return NULL;
}

static int
thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
{
struct thermal_hwmon_device *hwmon;
int new_hwmon_device = 1;
int result;

hwmon = thermal_hwmon_lookup_by_type(tz);
if (hwmon) {
new_hwmon_device = 0;
goto register_sys_interface;
}

hwmon = kzalloc(sizeof(struct thermal_hwmon_device), GFP_KERNEL);
if (!hwmon)
return -ENOMEM;
Expand Down

0 comments on commit ed959bd

Please sign in to comment.