Skip to content

Commit c9afb55

Browse files
corsair-hydro-platinum: Improve logging of command write failures
Previously this was wishy washy and only really done for FEATURE_COOLING_FAN3 commands (I was having particular issues there). Now it is more consistant and covers all fans + pump commands. Signed-off-by: Jack Greiner <jack@emoss.org>
1 parent 601b791 commit c9afb55

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/hwmon/corsair-hydro-platinum.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static int hydro_platinum_write_cooling(struct hydro_platinum_data *priv)
314314

315315
ret = hydro_platinum_transaction(priv, FEATURE_COOLING_FAN3, CMD_SET_COOLING, data2, sizeof(data2));
316316
if (ret)
317-
hid_warn(priv->hdev, "Failed to set Fan 3 speed: %d\n", ret);
317+
return ret;
318318
}
319319

320320
return 0;
@@ -509,6 +509,12 @@ static int hydro_platinum_write(struct device *dev, enum hwmon_sensor_types type
509509
}
510510

511511
ret = hydro_platinum_write_cooling(priv);
512+
if (ret) {
513+
if (channel == 0)
514+
hid_warn_ratelimited(priv->hdev, "Failed to set Pump speed: %d\n", ret);
515+
else
516+
hid_warn_ratelimited(priv->hdev, "Failed to set Fan %d speed: %d\n", channel, ret);
517+
}
512518
break;
513519
default:
514520
ret = -EOPNOTSUPP;

0 commit comments

Comments
 (0)