Skip to content

Commit

Permalink
nzxt-kraken3: Switch remaining wait_for_completion calls to interrupt…
Browse files Browse the repository at this point in the history
…ible variants

Signed-off-by: Aleksa Savic <[email protected]>
  • Loading branch information
aleksamagicka committed Oct 1, 2023
1 parent 49eb3a7 commit feadc83
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nzxt-kraken3.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ static int kraken3_read(struct device *dev, enum hwmon_sensor_types type, u32 at
* (but up to STATUS_VALIDITY seconds). This does not concern the Z series
* devices, because they send a sensor report only when requested.
*/
if (!wait_for_completion_timeout
if (wait_for_completion_interruptible_timeout
(&priv->status_report_processed,
msecs_to_jiffies(STATUS_VALIDITY * 1000)))
msecs_to_jiffies(STATUS_VALIDITY * 1000)) <= 0)
return -ENODATA;
} else if (priv->kind == Z53) {
/* Ensure that only one of the readers requests status */
Expand Down Expand Up @@ -801,7 +801,8 @@ static int firmware_version_show(struct seq_file *seqf, void *unused)
* The response to this request that the device sends is only catchable in
* kraken3_raw_event(), so we have to wait until it's processed there.
*/
wait_for_completion(&priv->fw_version_processed);
if (!wait_for_completion_interruptible(&priv->fw_version_processed))
return -ENODATA;

seq_printf(seqf, "%u.%u.%u\n", priv->firmware_version[0], priv->firmware_version[1],
priv->firmware_version[2]);
Expand Down

0 comments on commit feadc83

Please sign in to comment.