thermal_hwmon.c (a3479c7fc096a1a7a2dccbfbdc6fcf86b805711a) | thermal_hwmon.c (409ef0bacacf72c51cc876349ae3fdf7cf726d47) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * thermal_hwmon.c - Generic Thermal Management hwmon support. 4 * 5 * Code based on Intel thermal_core.c. Copyrights of the original code: 6 * Copyright (C) 2008 Intel Corp 7 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> 8 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> --- 128 unchanged lines hidden (view full) --- 137 } 138 139 hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); 140 if (!hwmon) 141 return -ENOMEM; 142 143 INIT_LIST_HEAD(&hwmon->tz_list); 144 strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * thermal_hwmon.c - Generic Thermal Management hwmon support. 4 * 5 * Code based on Intel thermal_core.c. Copyrights of the original code: 6 * Copyright (C) 2008 Intel Corp 7 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> 8 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> --- 128 unchanged lines hidden (view full) --- 137 } 138 139 hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); 140 if (!hwmon) 141 return -ENOMEM; 142 143 INIT_LIST_HEAD(&hwmon->tz_list); 144 strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); |
145 strreplace(hwmon->type, '-', '_'); |
|
145 hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type, 146 hwmon, NULL, NULL); 147 if (IS_ERR(hwmon->device)) { 148 result = PTR_ERR(hwmon->device); 149 goto free_mem; 150 } 151 152 register_sys_interface: --- 93 unchanged lines hidden --- | 146 hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type, 147 hwmon, NULL, NULL); 148 if (IS_ERR(hwmon->device)) { 149 result = PTR_ERR(hwmon->device); 150 goto free_mem; 151 } 152 153 register_sys_interface: --- 93 unchanged lines hidden --- |