diff options
Diffstat (limited to 'drivers/thermal/imx_thermal.c')
-rw-r--r-- | drivers/thermal/imx_thermal.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 4bec1d3c3d27..c8fe3cac2e0e 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c | |||
@@ -288,7 +288,7 @@ static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip, | |||
288 | if (trip == IMX_TRIP_CRITICAL) | 288 | if (trip == IMX_TRIP_CRITICAL) |
289 | return -EPERM; | 289 | return -EPERM; |
290 | 290 | ||
291 | if (temp > IMX_TEMP_PASSIVE) | 291 | if (temp < 0 || temp > IMX_TEMP_PASSIVE) |
292 | return -EINVAL; | 292 | return -EINVAL; |
293 | 293 | ||
294 | data->temp_passive = temp; | 294 | data->temp_passive = temp; |
@@ -487,14 +487,6 @@ static int imx_thermal_probe(struct platform_device *pdev) | |||
487 | if (data->irq < 0) | 487 | if (data->irq < 0) |
488 | return data->irq; | 488 | return data->irq; |
489 | 489 | ||
490 | ret = devm_request_threaded_irq(&pdev->dev, data->irq, | ||
491 | imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread, | ||
492 | 0, "imx_thermal", data); | ||
493 | if (ret < 0) { | ||
494 | dev_err(&pdev->dev, "failed to request alarm irq: %d\n", ret); | ||
495 | return ret; | ||
496 | } | ||
497 | |||
498 | platform_set_drvdata(pdev, data); | 490 | platform_set_drvdata(pdev, data); |
499 | 491 | ||
500 | ret = imx_get_sensor_data(pdev); | 492 | ret = imx_get_sensor_data(pdev); |
@@ -571,6 +563,17 @@ static int imx_thermal_probe(struct platform_device *pdev) | |||
571 | regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); | 563 | regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); |
572 | regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP); | 564 | regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP); |
573 | 565 | ||
566 | ret = devm_request_threaded_irq(&pdev->dev, data->irq, | ||
567 | imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread, | ||
568 | 0, "imx_thermal", data); | ||
569 | if (ret < 0) { | ||
570 | dev_err(&pdev->dev, "failed to request alarm irq: %d\n", ret); | ||
571 | clk_disable_unprepare(data->thermal_clk); | ||
572 | thermal_zone_device_unregister(data->tz); | ||
573 | cpufreq_cooling_unregister(data->cdev); | ||
574 | return ret; | ||
575 | } | ||
576 | |||
574 | data->irq_enabled = true; | 577 | data->irq_enabled = true; |
575 | data->mode = THERMAL_DEVICE_ENABLED; | 578 | data->mode = THERMAL_DEVICE_ENABLED; |
576 | 579 | ||