I addressed this concern in V6, could you please take a look and let me@@ -1161,11 +1197,24 @@ static int mtk_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mt);
- tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
- &mtk_thermal_ops);
- if (IS_ERR(tzdev)) {
- ret = PTR_ERR(tzdev);
- goto err_disable_clk_peri_therm;
+ for (i = 0; i < mt->conf->num_sensors + 1; i++) {
+ tz = devm_kmalloc(&pdev->dev, sizeof(*tz), GFP_KERNEL);
+ if (!tz)
+ return -ENOMEM;
+
+ tz->mt = mt;
+ tz->id = i;
+
+ tzdev = devm_thermal_of_zone_register(&pdev->dev, i, tz, (i == 0) ?
+ &mtk_thermal_ops :
+ &mtk_thermal_sensor_ops);
Here you use again the aggregation
know what you think [0].
[0]: https://lore.kernel.org/all/5eb0cdc2-e9f9-dd42-bf80-b7dcd8bcc196@xxxxxxxxxxxx/