Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal management fix from Zhang Rui:
"A single revert from a recently introduced problem.

Specifics:

Commit 7611fb68062f ("thermal: thermal_hwmon: Convert to
hwmon_device_register_with_info()"), which was introduced in 4.10-rc5,
uses new hwmon API. But this breaks some soc thermal driver because
the new hwmon API has a strict rule for the hwmon device name. Revert
the offending commit as a quick solution for 4.10"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
Revert "thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()"

+17 -3
+17 -3
drivers/thermal/thermal_hwmon.c
··· 59 static DEFINE_MUTEX(thermal_hwmon_list_lock); 60 61 static ssize_t 62 temp_input_show(struct device *dev, struct device_attribute *attr, char *buf) 63 { 64 int temperature; ··· 165 166 INIT_LIST_HEAD(&hwmon->tz_list); 167 strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); 168 - hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type, 169 - hwmon, NULL, NULL); 170 if (IS_ERR(hwmon->device)) { 171 result = PTR_ERR(hwmon->device); 172 goto free_mem; 173 } 174 175 register_sys_interface: 176 temp = kzalloc(sizeof(*temp), GFP_KERNEL); ··· 222 free_temp_mem: 223 kfree(temp); 224 unregister_name: 225 - if (new_hwmon_device) 226 hwmon_device_unregister(hwmon->device); 227 free_mem: 228 if (new_hwmon_device) 229 kfree(hwmon); ··· 267 list_del(&hwmon->node); 268 mutex_unlock(&thermal_hwmon_list_lock); 269 270 hwmon_device_unregister(hwmon->device); 271 kfree(hwmon); 272 }
··· 59 static DEFINE_MUTEX(thermal_hwmon_list_lock); 60 61 static ssize_t 62 + name_show(struct device *dev, struct device_attribute *attr, char *buf) 63 + { 64 + struct thermal_hwmon_device *hwmon = dev_get_drvdata(dev); 65 + return sprintf(buf, "%s\n", hwmon->type); 66 + } 67 + static DEVICE_ATTR_RO(name); 68 + 69 + static ssize_t 70 temp_input_show(struct device *dev, struct device_attribute *attr, char *buf) 71 { 72 int temperature; ··· 157 158 INIT_LIST_HEAD(&hwmon->tz_list); 159 strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); 160 + hwmon->device = hwmon_device_register(NULL); 161 if (IS_ERR(hwmon->device)) { 162 result = PTR_ERR(hwmon->device); 163 goto free_mem; 164 } 165 + dev_set_drvdata(hwmon->device, hwmon); 166 + result = device_create_file(hwmon->device, &dev_attr_name); 167 + if (result) 168 + goto free_mem; 169 170 register_sys_interface: 171 temp = kzalloc(sizeof(*temp), GFP_KERNEL); ··· 211 free_temp_mem: 212 kfree(temp); 213 unregister_name: 214 + if (new_hwmon_device) { 215 + device_remove_file(hwmon->device, &dev_attr_name); 216 hwmon_device_unregister(hwmon->device); 217 + } 218 free_mem: 219 if (new_hwmon_device) 220 kfree(hwmon); ··· 254 list_del(&hwmon->node); 255 mutex_unlock(&thermal_hwmon_list_lock); 256 257 + device_remove_file(hwmon->device, &dev_attr_name); 258 hwmon_device_unregister(hwmon->device); 259 kfree(hwmon); 260 }