Skip to content

Commit 41fa9a9

Browse files
committed
hwmon: (nct6775) Drop unsupported fan alarm attributes for NCT6775
NCT6775 does not support alarms for fans 4 and 5. Drop the attributes. cc: [email protected] # 3.10+ Signed-off-by: Guenter Roeck <[email protected]>
1 parent b1d2bff commit 41fa9a9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/hwmon/nct6775.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static const s8 NCT6775_ALARM_BITS[] = {
199199
0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */
200200
17, -1, -1, -1, -1, -1, -1, /* in8..in14 */
201201
-1, /* unused */
202-
6, 7, 11, 10, 23, /* fan1..fan5 */
202+
6, 7, 11, -1, -1, /* fan1..fan5 */
203203
-1, -1, -1, /* unused */
204204
4, 5, 13, -1, -1, -1, /* temp1..temp6 */
205205
12, -1 }; /* intrusion0, intrusion1 */
@@ -3877,10 +3877,12 @@ static int nct6775_probe(struct platform_device *pdev)
38773877
&sda_fan_input[i].dev_attr);
38783878
if (err)
38793879
goto exit_remove;
3880-
err = device_create_file(dev,
3881-
&sda_fan_alarm[i].dev_attr);
3882-
if (err)
3883-
goto exit_remove;
3880+
if (data->ALARM_BITS[FAN_ALARM_BASE + i] >= 0) {
3881+
err = device_create_file(dev,
3882+
&sda_fan_alarm[i].dev_attr);
3883+
if (err)
3884+
goto exit_remove;
3885+
}
38843886
if (data->kind != nct6776 &&
38853887
data->kind != nct6779) {
38863888
err = device_create_file(dev,

0 commit comments

Comments
 (0)