summaryrefslogtreecommitdiff
path: root/drivers/thermal/amlogic_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/amlogic_thermal.c')
-rw-r--r--drivers/thermal/amlogic_thermal.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 9235fda4ec1e..3abc2dcef408 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -181,7 +181,7 @@ static int amlogic_thermal_disable(struct amlogic_thermal *data)
static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
{
unsigned int tval;
- struct amlogic_thermal *pdata = tz->devdata;
+ struct amlogic_thermal *pdata = thermal_zone_device_priv(tz);
if (!pdata)
return -EINVAL;
@@ -262,11 +262,8 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
return PTR_ERR(pdata->regmap);
pdata->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(pdata->clk)) {
- if (PTR_ERR(pdata->clk) != -EPROBE_DEFER)
- dev_err(dev, "failed to get clock\n");
- return PTR_ERR(pdata->clk);
- }
+ if (IS_ERR(pdata->clk))
+ return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n");
pdata->sec_ao_map = syscon_regmap_lookup_by_phandle
(pdev->dev.of_node, "amlogic,ao-secure");
@@ -285,7 +282,7 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
+ if (devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd))
dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
ret = amlogic_thermal_initialize(pdata);