Skip to content

Commit 628cee6

Browse files
krx62: remove unnecessary hwmon attr tests
1 parent 917faed commit 628cee6

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

krx62.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ static int krx62_read(struct device *dev, enum hwmon_sensor_types type,
3434

3535
switch (type) {
3636
case hwmon_temp:
37-
if (attr != hwmon_temp_input)
38-
return -EINVAL;
3937
*val = ldata->temp_input;
4038
break;
4139
case hwmon_fan:
42-
if (attr != hwmon_fan_input || channel >= KRX62_RPM_INPUTS)
40+
if (channel >= KRX62_RPM_INPUTS)
4341
return -EINVAL;
4442
*val = ldata->fan_input[channel];
4543
break;
@@ -49,9 +47,7 @@ static int krx62_read(struct device *dev, enum hwmon_sensor_types type,
4947
return 0;
5048
}
5149

52-
static const char *const krx62_temp_label[] = {
53-
"Coolant",
54-
};
50+
#define KRX62_TEMP_LABEL "Coolant"
5551

5652
static const char *const krx62_fan_label[] = {
5753
NULL,
@@ -64,14 +60,10 @@ static int krx62_read_string(struct device *dev,
6460
{
6561
switch (type) {
6662
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;
7164
break;
7265
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])
7567
return -EINVAL;
7668
*str = krx62_fan_label[channel];
7769
break;
@@ -87,7 +79,7 @@ static const struct hwmon_ops krx62_hwmon_ops = {
8779
.read_string = krx62_read_string,
8880
};
8981

90-
#define DEVNAME_KRAKEN_GEN3 "kraken" /* FIXME */
82+
#define DEVNAME_KRAKEN_GEN3 "krakenx" /* FIXME */
9183

9284
static const u32 krx62_temp_config[] = {
9385
HWMON_T_INPUT | HWMON_T_LABEL,

0 commit comments

Comments
 (0)