File tree 1 file changed +6
-2
lines changed
drivers/net/ethernet/chelsio/cxgb4 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ static struct thermal_zone_device_ops cxgb4_thermal_ops = {
62
62
int cxgb4_thermal_init (struct adapter * adap )
63
63
{
64
64
struct ch_thermal * ch_thermal = & adap -> ch_thermal ;
65
+ char ch_tz_name [THERMAL_NAME_LENGTH ];
65
66
int num_trip = CXGB4_NUM_TRIPS ;
66
67
u32 param , val ;
67
68
int ret ;
@@ -82,7 +83,8 @@ int cxgb4_thermal_init(struct adapter *adap)
82
83
ch_thermal -> trip_type = THERMAL_TRIP_CRITICAL ;
83
84
}
84
85
85
- ch_thermal -> tzdev = thermal_zone_device_register ("cxgb4" , num_trip ,
86
+ snprintf (ch_tz_name , sizeof (ch_tz_name ), "cxgb4_%s" , adap -> name );
87
+ ch_thermal -> tzdev = thermal_zone_device_register (ch_tz_name , num_trip ,
86
88
0 , adap ,
87
89
& cxgb4_thermal_ops ,
88
90
NULL , 0 , 0 );
@@ -97,7 +99,9 @@ int cxgb4_thermal_init(struct adapter *adap)
97
99
98
100
int cxgb4_thermal_remove (struct adapter * adap )
99
101
{
100
- if (adap -> ch_thermal .tzdev )
102
+ if (adap -> ch_thermal .tzdev ) {
101
103
thermal_zone_device_unregister (adap -> ch_thermal .tzdev );
104
+ adap -> ch_thermal .tzdev = NULL ;
105
+ }
102
106
return 0 ;
103
107
}
You can’t perform that action at this time.
0 commit comments