summaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal-generic-adc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/thermal-generic-adc.c')
-rw-r--r--drivers/thermal/thermal-generic-adc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
index ae5743c9a894..226e3c2b7469 100644
--- a/drivers/thermal/thermal-generic-adc.c
+++ b/drivers/thermal/thermal-generic-adc.c
@@ -124,13 +124,6 @@ static int gadc_thermal_probe(struct platform_device *pdev)
if (!gti)
return -ENOMEM;
- ret = gadc_thermal_read_linear_lookup_table(&pdev->dev, gti);
- if (ret < 0)
- return ret;
-
- gti->dev = &pdev->dev;
- platform_set_drvdata(pdev, gti);
-
gti->channel = devm_iio_channel_get(&pdev->dev, "sensor-channel");
if (IS_ERR(gti->channel)) {
ret = PTR_ERR(gti->channel);
@@ -139,6 +132,13 @@ static int gadc_thermal_probe(struct platform_device *pdev)
return ret;
}
+ ret = gadc_thermal_read_linear_lookup_table(&pdev->dev, gti);
+ if (ret < 0)
+ return ret;
+
+ gti->dev = &pdev->dev;
+ platform_set_drvdata(pdev, gti);
+
gti->tz_dev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, gti,
&gadc_thermal_ops);
if (IS_ERR(gti->tz_dev)) {