Skip to content

Commit ff70c8d

Browse files
corsair-hydro-platinum: Fix compiler warnings
So we can support older kernel versions we need to use dev_warn_ratelimited and dev_err_ratelimited as it turns out hid_err_ratelimited and hid_warn_ratelimited are newer helper macros. Signed-off-by: Jack Greiner <jack@emoss.org>
1 parent c9afb55 commit ff70c8d

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

drivers/hwmon/corsair-hydro-platinum.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,18 @@ static int hydro_platinum_send_command(struct hydro_platinum_data *priv, u8 feat
193193
static int hydro_platinum_transaction(struct hydro_platinum_data *priv, u8 feature, u8 command, u8 *data, int data_len)
194194
{
195195
int ret;
196-
u8 sent_seq;
197196

198197
reinit_completion(&priv->wait_for_report);
199198

200199
ret = hydro_platinum_send_command(priv, feature, command, data, data_len);
201200
if (ret < 0) {
202-
hid_err_ratelimited(priv->hdev, "Failed to send command %02x: %d\n", command, ret);
201+
dev_err_ratelimited(&priv->hdev->dev, "Failed to send command %02x: %d\n", command, ret);
203202
return ret;
204203
}
205204

206-
sent_seq = priv->sequence;
207-
208205
ret = wait_for_completion_interruptible_timeout(&priv->wait_for_report, msecs_to_jiffies(500));
209206
if (ret == 0) {
210-
hid_warn_ratelimited(priv->hdev, "Timeout waiting for response to command %02x\n", command);
207+
dev_warn_ratelimited(&priv->hdev->dev, "Timeout waiting for response to command %02x\n", command);
211208
return -ETIMEDOUT;
212209
} else if (ret < 0) {
213210
return ret;
@@ -227,7 +224,7 @@ static int hydro_platinum_transaction(struct hydro_platinum_data *priv, u8 featu
227224
* confuse the device state machine and cause firmware crashes/reboots.
228225
*/
229226
if (crc8(corsair_crc8_table, priv->rx_buffer + 1, REPORT_LENGTH - 1, 0) != 0) {
230-
hid_warn_ratelimited(priv->hdev, "CRC check failed for command %02x - possible userspace collision\n", command);
227+
dev_warn_ratelimited(&priv->hdev->dev, "CRC check failed for command %02x - possible userspace collision\n", command);
231228
return -EIO;
232229
}
233230

@@ -511,9 +508,9 @@ static int hydro_platinum_write(struct device *dev, enum hwmon_sensor_types type
511508
ret = hydro_platinum_write_cooling(priv);
512509
if (ret) {
513510
if (channel == 0)
514-
hid_warn_ratelimited(priv->hdev, "Failed to set Pump speed: %d\n", ret);
511+
dev_warn_ratelimited(&priv->hdev->dev, "Failed to set Pump speed: %d\n", ret);
515512
else
516-
hid_warn_ratelimited(priv->hdev, "Failed to set Fan %d speed: %d\n", channel, ret);
513+
dev_warn_ratelimited(&priv->hdev->dev, "Failed to set Fan %d speed: %d\n", channel, ret);
517514
}
518515
break;
519516
default:

0 commit comments

Comments
 (0)