aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Smirnov <[email protected]>2019-12-10 08:41:46 -0800
committerDaniel Lezcano <[email protected]>2020-01-27 10:24:32 +0100
commit03036625d35b6b9c152bb81e406aaf98a7cd3c85 (patch)
treec34a1ff5bfd4687928748278f02697b5525c57d7
parentb319da1b00d28fb7717784a81e5d9ecac0e98bec (diff)
thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directly
Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a platform device and then deriving it. This is done as a first step to simplify resource deallocation code. Signed-off-by: Andrey Smirnov <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/thermal/qoriq_thermal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 9886daf8ac97..f024ac68e2ed 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -157,9 +157,9 @@ static const struct thermal_zone_of_device_ops tmu_tz_ops = {
.get_temp = tmu_get_temp,
};
-static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev)
+static int qoriq_tmu_register_tmu_zone(struct device *dev,
+ struct qoriq_tmu_data *qdata)
{
- struct qoriq_tmu_data *qdata = platform_get_drvdata(pdev);
int id, sites = 0;
for (id = 0; id < SITES_MAX; id++) {
@@ -169,7 +169,7 @@ static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev)
sensor->id = id;
- tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id,
+ tzd = devm_thermal_zone_of_sensor_register(dev, id,
sensor,
&tmu_tz_ops);
ret = PTR_ERR_OR_ZERO(tzd);
@@ -303,7 +303,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
if (ret < 0)
goto err;
- ret = qoriq_tmu_register_tmu_zone(pdev);
+ ret = qoriq_tmu_register_tmu_zone(dev, data);
if (ret < 0) {
dev_err(dev, "Failed to register sensors\n");
ret = -ENODEV;