Merge "drivers: lmh_dcvsh: Use allocated variable for LMH DCVSh sensor name"

This commit is contained in:
Linux Build Service Account 2017-03-09 10:13:32 -08:00 committed by Gerrit - the friendly Code Review server
commit 8d7e3b67c7

View file

@ -78,6 +78,7 @@ enum lmh_hw_trips {
}; };
struct msm_lmh_dcvs_hw { struct msm_lmh_dcvs_hw {
char sensor_name[THERMAL_NAME_LENGTH];
uint32_t affinity; uint32_t affinity;
uint32_t temp_limits[LIMITS_TRIP_MAX]; uint32_t temp_limits[LIMITS_TRIP_MAX];
struct sensor_threshold default_lo, default_hi; struct sensor_threshold default_lo, default_hi;
@ -381,7 +382,6 @@ static int msm_lmh_dcvs_probe(struct platform_device *pdev)
int ret; int ret;
int affinity = -1; int affinity = -1;
struct msm_lmh_dcvs_hw *hw; struct msm_lmh_dcvs_hw *hw;
char sensor_name[] = "limits_sensor-00";
struct thermal_zone_device *tzdev; struct thermal_zone_device *tzdev;
struct thermal_cooling_device *cdev; struct thermal_cooling_device *cdev;
struct device_node *dn = pdev->dev.of_node; struct device_node *dn = pdev->dev.of_node;
@ -450,9 +450,9 @@ static int msm_lmh_dcvs_probe(struct platform_device *pdev)
* Let's register with thermal framework, so we have the ability * Let's register with thermal framework, so we have the ability
* to set low/high thresholds. * to set low/high thresholds.
*/ */
snprintf(sensor_name, sizeof(sensor_name), "limits_sensor-%02d", snprintf(hw->sensor_name, sizeof(hw->sensor_name), "limits_sensor-%02d",
affinity); affinity);
tzdev = thermal_zone_device_register(sensor_name, LIMITS_TRIP_MAX, tzdev = thermal_zone_device_register(hw->sensor_name, LIMITS_TRIP_MAX,
(1 << LIMITS_TRIP_MAX) - 1, hw, &limits_sensor_ops, (1 << LIMITS_TRIP_MAX) - 1, hw, &limits_sensor_ops,
NULL, 0, 0); NULL, 0, 0);
if (IS_ERR_OR_NULL(tzdev)) if (IS_ERR_OR_NULL(tzdev))
@ -467,7 +467,7 @@ static int msm_lmh_dcvs_probe(struct platform_device *pdev)
* Since we make a check for hi > lo value, set the hi threshold * Since we make a check for hi > lo value, set the hi threshold
* before the low threshold * before the low threshold
*/ */
id = sensor_get_id(sensor_name); id = sensor_get_id(hw->sensor_name);
if (id < 0) if (id < 0)
return id; return id;
@ -525,7 +525,7 @@ static int msm_lmh_dcvs_probe(struct platform_device *pdev)
set_bit(1, hw->is_irq_enabled); set_bit(1, hw->is_irq_enabled);
ret = devm_request_threaded_irq(&pdev->dev, hw->irq_num, NULL, ret = devm_request_threaded_irq(&pdev->dev, hw->irq_num, NULL,
lmh_dcvs_handle_isr, IRQF_TRIGGER_HIGH | IRQF_ONESHOT lmh_dcvs_handle_isr, IRQF_TRIGGER_HIGH | IRQF_ONESHOT
| IRQF_NO_SUSPEND, sensor_name, hw); | IRQF_NO_SUSPEND, hw->sensor_name, hw);
if (ret) { if (ret) {
pr_err("Error registering for irq. err:%d\n", ret); pr_err("Error registering for irq. err:%d\n", ret);
return ret; return ret;