diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2017-03-29 14:43:53 -0400 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2017-03-31 00:42:42 -0400 |
commit | 97dad1f1d2b3f2a2a77551849357b7ac38b0b6ff (patch) | |
tree | 5813468429ce345662f3be484856d8de1414dbfd /drivers | |
parent | d51546c0db975a4750161d17eef62dfcf9eedc90 (diff) |
thermal: rcar_gen3_thermal: record and check number of TSCs found
Record how many TSCs are found in struct rcar_gen3_thermal_priv, this is
needed to be able to add hardware interrupts for trip points later. Also
add a check to make sure at least one TSC is found.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/thermal/rcar_gen3_thermal.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 9b6bc03dd142..4a08b35533dc 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c | |||
@@ -75,6 +75,7 @@ struct rcar_gen3_thermal_tsc { | |||
75 | 75 | ||
76 | struct rcar_gen3_thermal_priv { | 76 | struct rcar_gen3_thermal_priv { |
77 | struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; | 77 | struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; |
78 | unsigned int num_tscs; | ||
78 | }; | 79 | }; |
79 | 80 | ||
80 | struct rcar_gen3_thermal_data { | 81 | struct rcar_gen3_thermal_data { |
@@ -307,6 +308,13 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) | |||
307 | tsc->zone = zone; | 308 | tsc->zone = zone; |
308 | } | 309 | } |
309 | 310 | ||
311 | priv->num_tscs = i; | ||
312 | |||
313 | if (!priv->num_tscs) { | ||
314 | ret = -ENODEV; | ||
315 | goto error_unregister; | ||
316 | } | ||
317 | |||
310 | return 0; | 318 | return 0; |
311 | 319 | ||
312 | error_unregister: | 320 | error_unregister: |