The struct rcar_gen3_thermal_tsc benefits from knowing which TSC it
represent. Record this at probe time before this information is lost.

Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
 drivers/thermal/rcar_gen3_thermal.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/rcar_gen3_thermal.c 
b/drivers/thermal/rcar_gen3_thermal.c
index 5d4a5483eb13e796..65f7204936a18278 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -68,6 +68,8 @@ struct equation_coefs {
 };
 
 struct rcar_gen3_thermal_tsc {
+       struct device *dev;
+       int num;
        void __iomem *base;
        struct thermal_zone_device *zone;
        struct equation_coefs coef;
@@ -282,6 +284,9 @@ static int rcar_gen3_thermal_probe(struct platform_device 
*pdev)
                        goto error_unregister;
                }
 
+               tsc->dev = dev;
+               tsc->num = i;
+
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
                if (!res) {
                        ret = -ENODEV;
-- 
2.12.0

Reply via email to