Skip to content

Commit 0dfe14f

Browse files
committed
Merge tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - acpi_power_meter: Fix 4.29 MW output seen if acpi reports bad data - corsair-psu: Fix ability to probe if the driver is built into the kernel - ltc2991: Fix spelling mistake "contiuous" -> "continuous" - max31827: Add missing regulator header file include - nzxt-kraken2: Fix error handling path in probe function * tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (corsair-psu) Fix probe when built-in hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() hwmon: (acpi_power_meter) Fix 4.29 MW bug hwmon: max31827: include regulator header hwmon: ltc2991: Fix spelling mistake "contiuous" -> "continuous"
2 parents d650b3b + 307004e commit 0dfe14f

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

drivers/hwmon/acpi_power_meter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define POWER_METER_CAN_NOTIFY (1 << 3)
3232
#define POWER_METER_IS_BATTERY (1 << 8)
3333
#define UNKNOWN_HYSTERESIS 0xFFFFFFFF
34+
#define UNKNOWN_POWER 0xFFFFFFFF
3435

3536
#define METER_NOTIFY_CONFIG 0x80
3637
#define METER_NOTIFY_TRIP 0x81
@@ -348,6 +349,9 @@ static ssize_t show_power(struct device *dev,
348349
update_meter(resource);
349350
mutex_unlock(&resource->lock);
350351

352+
if (resource->power == UNKNOWN_POWER)
353+
return -ENODATA;
354+
351355
return sprintf(buf, "%llu\n", resource->power * 1000);
352356
}
353357

drivers/hwmon/corsair-psu.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,23 @@ static struct hid_driver corsairpsu_driver = {
899899
.reset_resume = corsairpsu_resume,
900900
#endif
901901
};
902-
module_hid_driver(corsairpsu_driver);
902+
903+
static int __init corsair_init(void)
904+
{
905+
return hid_register_driver(&corsairpsu_driver);
906+
}
907+
908+
static void __exit corsair_exit(void)
909+
{
910+
hid_unregister_driver(&corsairpsu_driver);
911+
}
912+
913+
/*
914+
* With module_init() the driver would load before the HID bus when
915+
* built-in, so use late_initcall() instead.
916+
*/
917+
late_initcall(corsair_init);
918+
module_exit(corsair_exit);
903919

904920
MODULE_LICENSE("GPL");
905921
MODULE_AUTHOR("Wilken Gottwalt <[email protected]>");

drivers/hwmon/ltc2991.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static int ltc2991_init(struct ltc2991_state *st)
373373
LTC2991_REPEAT_ACQ_EN);
374374
if (ret)
375375
return dev_err_probe(st->dev, ret,
376-
"Error: Failed to set contiuous mode.\n");
376+
"Error: Failed to set continuous mode.\n");
377377

378378
/* Enable all channels and trigger conversions */
379379
return regmap_write(st->regmap, LTC2991_CH_EN_TRIGGER,

drivers/hwmon/max31827.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/i2c.h>
1313
#include <linux/mutex.h>
1414
#include <linux/regmap.h>
15+
#include <linux/regulator/consumer.h>
1516

1617
#define MAX31827_T_REG 0x0
1718
#define MAX31827_CONFIGURATION_REG 0x2

drivers/hwmon/nzxt-kraken2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ static int kraken2_probe(struct hid_device *hdev,
161161
ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
162162
if (ret) {
163163
hid_err(hdev, "hid hw start failed with %d\n", ret);
164-
goto fail_and_stop;
164+
return ret;
165165
}
166166

167167
ret = hid_hw_open(hdev);
168168
if (ret) {
169169
hid_err(hdev, "hid hw open failed with %d\n", ret);
170-
goto fail_and_close;
170+
goto fail_and_stop;
171171
}
172172

173173
priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2",

0 commit comments

Comments
 (0)