@@ -650,9 +650,9 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on)
650
650
writel (con , data -> base + EXYNOS_TMU_REG_CONTROL );
651
651
}
652
652
653
- static int exynos_get_temp (void * p , int * temp )
653
+ static int exynos_get_temp (struct thermal_zone_device * tz , int * temp )
654
654
{
655
- struct exynos_tmu_data * data = p ;
655
+ struct exynos_tmu_data * data = tz -> devdata ;
656
656
int value , ret = 0 ;
657
657
658
658
if (!data || !data -> tmu_read )
@@ -728,9 +728,9 @@ static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
728
728
writel (val , data -> base + emul_con );
729
729
}
730
730
731
- static int exynos_tmu_set_emulation (void * drv_data , int temp )
731
+ static int exynos_tmu_set_emulation (struct thermal_zone_device * tz , int temp )
732
732
{
733
- struct exynos_tmu_data * data = drv_data ;
733
+ struct exynos_tmu_data * data = tz -> devdata ;
734
734
int ret = - EINVAL ;
735
735
736
736
if (data -> soc == SOC_ARCH_EXYNOS4210 )
@@ -750,7 +750,7 @@ static int exynos_tmu_set_emulation(void *drv_data, int temp)
750
750
}
751
751
#else
752
752
#define exynos4412_tmu_set_emulation NULL
753
- static int exynos_tmu_set_emulation (void * drv_data , int temp )
753
+ static int exynos_tmu_set_emulation (struct thermal_zone_device * tz , int temp )
754
754
{ return - EINVAL ; }
755
755
#endif /* CONFIG_THERMAL_EMULATION */
756
756
@@ -997,7 +997,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
997
997
return 0 ;
998
998
}
999
999
1000
- static const struct thermal_zone_of_device_ops exynos_sensor_ops = {
1000
+ static const struct thermal_zone_device_ops exynos_sensor_ops = {
1001
1001
.get_temp = exynos_get_temp ,
1002
1002
.set_emul_temp = exynos_tmu_set_emulation ,
1003
1003
};
@@ -1091,8 +1091,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
1091
1091
* data->tzd must be registered before calling exynos_tmu_initialize(),
1092
1092
* requesting irq and calling exynos_tmu_control().
1093
1093
*/
1094
- data -> tzd = thermal_zone_of_sensor_register (& pdev -> dev , 0 , data ,
1095
- & exynos_sensor_ops );
1094
+ data -> tzd = devm_thermal_of_zone_register (& pdev -> dev , 0 , data ,
1095
+ & exynos_sensor_ops );
1096
1096
if (IS_ERR (data -> tzd )) {
1097
1097
ret = PTR_ERR (data -> tzd );
1098
1098
if (ret != - EPROBE_DEFER )
@@ -1104,21 +1104,19 @@ static int exynos_tmu_probe(struct platform_device *pdev)
1104
1104
ret = exynos_tmu_initialize (pdev );
1105
1105
if (ret ) {
1106
1106
dev_err (& pdev -> dev , "Failed to initialize TMU\n" );
1107
- goto err_thermal ;
1107
+ goto err_sclk ;
1108
1108
}
1109
1109
1110
1110
ret = devm_request_irq (& pdev -> dev , data -> irq , exynos_tmu_irq ,
1111
1111
IRQF_TRIGGER_RISING | IRQF_SHARED , dev_name (& pdev -> dev ), data );
1112
1112
if (ret ) {
1113
1113
dev_err (& pdev -> dev , "Failed to request irq: %d\n" , data -> irq );
1114
- goto err_thermal ;
1114
+ goto err_sclk ;
1115
1115
}
1116
1116
1117
1117
exynos_tmu_control (pdev , true);
1118
1118
return 0 ;
1119
1119
1120
- err_thermal :
1121
- thermal_zone_of_sensor_unregister (& pdev -> dev , data -> tzd );
1122
1120
err_sclk :
1123
1121
clk_disable_unprepare (data -> sclk );
1124
1122
err_clk :
@@ -1136,9 +1134,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
1136
1134
static int exynos_tmu_remove (struct platform_device * pdev )
1137
1135
{
1138
1136
struct exynos_tmu_data * data = platform_get_drvdata (pdev );
1139
- struct thermal_zone_device * tzd = data -> tzd ;
1140
1137
1141
- thermal_zone_of_sensor_unregister (& pdev -> dev , tzd );
1142
1138
exynos_tmu_control (pdev , false);
1143
1139
1144
1140
clk_disable_unprepare (data -> sclk );
0 commit comments