@@ -34,12 +34,10 @@ static int krx62_read(struct device *dev, enum hwmon_sensor_types type,
34
34
35
35
switch (type ) {
36
36
case hwmon_temp :
37
- if (attr != hwmon_temp_input )
38
- return - EINVAL ;
39
37
* val = ldata -> temp_input ;
40
38
break ;
41
39
case hwmon_fan :
42
- if (attr != hwmon_fan_input || channel >= KRX62_RPM_INPUTS )
40
+ if (channel >= KRX62_RPM_INPUTS )
43
41
return - EINVAL ;
44
42
* val = ldata -> fan_input [channel ];
45
43
break ;
@@ -49,9 +47,7 @@ static int krx62_read(struct device *dev, enum hwmon_sensor_types type,
49
47
return 0 ;
50
48
}
51
49
52
- static const char * const krx62_temp_label [] = {
53
- "Coolant" ,
54
- };
50
+ #define KRX62_TEMP_LABEL "Coolant"
55
51
56
52
static const char * const krx62_fan_label [] = {
57
53
NULL ,
@@ -64,14 +60,10 @@ static int krx62_read_string(struct device *dev,
64
60
{
65
61
switch (type ) {
66
62
case hwmon_temp :
67
- if (attr != hwmon_temp_label || channel >= ARRAY_SIZE (krx62_temp_label ) ||
68
- !krx62_temp_label [channel ])
69
- return - EINVAL ;
70
- * str = krx62_temp_label [channel ];
63
+ * str = KRX62_TEMP_LABEL ;
71
64
break ;
72
65
case hwmon_fan :
73
- if (attr != hwmon_fan_label || channel >= ARRAY_SIZE (krx62_fan_label ) ||
74
- !krx62_fan_label [channel ])
66
+ if (channel >= KRX62_RPM_INPUTS || !krx62_fan_label [channel ])
75
67
return - EINVAL ;
76
68
* str = krx62_fan_label [channel ];
77
69
break ;
@@ -87,7 +79,7 @@ static const struct hwmon_ops krx62_hwmon_ops = {
87
79
.read_string = krx62_read_string ,
88
80
};
89
81
90
- #define DEVNAME_KRAKEN_GEN3 "kraken " /* FIXME */
82
+ #define DEVNAME_KRAKEN_GEN3 "krakenx " /* FIXME */
91
83
92
84
static const u32 krx62_temp_config [] = {
93
85
HWMON_T_INPUT | HWMON_T_LABEL ,
0 commit comments