Skip to content

Commit cc4d072

Browse files
Niklas SöderlundEduardo Valentin
authored andcommitted
thermal: rcar_gen3_thermal: store device match data in private structure
The device match data needs to be accessible outside the probe function, store it in the private data structure. Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
1 parent 7d4b269 commit cc4d072

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct rcar_gen3_thermal_priv {
8888
struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM];
8989
unsigned int num_tscs;
9090
spinlock_t lock; /* Protect interrupts on and off */
91+
const struct rcar_gen3_thermal_data *data;
9192
};
9293

9394
struct rcar_gen3_thermal_data {
@@ -351,8 +352,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
351352
struct thermal_zone_device *zone;
352353
int ret, irq, i;
353354
char *irqname;
354-
const struct rcar_gen3_thermal_data *match_data =
355-
of_device_get_match_data(dev);
356355

357356
/* default values if FUSEs are missing */
358357
/* TODO: Read values from hardware on supported platforms */
@@ -367,6 +366,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
367366
if (!priv)
368367
return -ENOMEM;
369368

369+
priv->data = of_device_get_match_data(dev);
370+
370371
spin_lock_init(&priv->lock);
371372

372373
platform_set_drvdata(pdev, priv);
@@ -417,7 +418,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
417418

418419
priv->tscs[i] = tsc;
419420

420-
match_data->thermal_init(tsc);
421+
priv->data->thermal_init(tsc);
421422
rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);
422423

423424
zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,

0 commit comments

Comments
 (0)