Skip to content

Commit 6f21671

Browse files
committed
Merge tag 'hwmon-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - Fix typo in Kconfig SENSORS_IR35221 option - Fix potential memory leak in acpi_power_meter_add() - Make sure the OVERT mask is set correctly in max6697 driver - In PMBus core, fix page vs. register when accessing fans - Mark is_visible functions static in bt1-pvt driver - Define Temp- and Volt-to-N poly as maybe-unused in bt1-pvt driver * tag 'hwmon-for-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (pmbus) fix a typo in Kconfig SENSORS_IR35221 option hwmon: (acpi_power_meter) Fix potential memory leak in acpi_power_meter_add() hwmon: (max6697) Make sure the OVERT mask is set correctly hwmon: (pmbus) Fix page vs. register when accessing fans hwmon: (bt1-pvt) Mark is_visible functions static hwmon: (bt1-pvt) Define Temp- and Volt-to-N poly as maybe-unused
2 parents bc2391e + 0d24247 commit 6f21671

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

drivers/hwmon/acpi_power_meter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static int acpi_power_meter_add(struct acpi_device *device)
883883

884884
res = setup_attrs(resource);
885885
if (res)
886-
goto exit_free;
886+
goto exit_free_capability;
887887

888888
resource->hwmon_dev = hwmon_device_register(&device->dev);
889889
if (IS_ERR(resource->hwmon_dev)) {
@@ -896,6 +896,8 @@ static int acpi_power_meter_add(struct acpi_device *device)
896896

897897
exit_remove:
898898
remove_attrs(resource);
899+
exit_free_capability:
900+
free_capabilities(resource);
899901
exit_free:
900902
kfree(resource);
901903
exit:

drivers/hwmon/bt1-pvt.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static const struct pvt_sensor_info pvt_info[] = {
6464
* 48380,
6565
* where T = [-48380, 147438] mC and N = [0, 1023].
6666
*/
67-
static const struct pvt_poly poly_temp_to_N = {
67+
static const struct pvt_poly __maybe_unused poly_temp_to_N = {
6868
.total_divider = 10000,
6969
.terms = {
7070
{4, 18322, 10000, 10000},
@@ -96,7 +96,7 @@ static const struct pvt_poly poly_N_to_temp = {
9696
* N = (18658e-3*V - 11572) / 10,
9797
* V = N * 10^5 / 18658 + 11572 * 10^4 / 18658.
9898
*/
99-
static const struct pvt_poly poly_volt_to_N = {
99+
static const struct pvt_poly __maybe_unused poly_volt_to_N = {
100100
.total_divider = 10,
101101
.terms = {
102102
{1, 18658, 1000, 1},
@@ -300,12 +300,12 @@ static irqreturn_t pvt_soft_isr(int irq, void *data)
300300
return IRQ_HANDLED;
301301
}
302302

303-
inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
303+
static inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
304304
{
305305
return 0644;
306306
}
307307

308-
inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
308+
static inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
309309
{
310310
return 0444;
311311
}
@@ -462,12 +462,12 @@ static irqreturn_t pvt_hard_isr(int irq, void *data)
462462

463463
#define pvt_soft_isr NULL
464464

465-
inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
465+
static inline umode_t pvt_limit_is_visible(enum pvt_sensor_type type)
466466
{
467467
return 0;
468468
}
469469

470-
inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
470+
static inline umode_t pvt_alarm_is_visible(enum pvt_sensor_type type)
471471
{
472472
return 0;
473473
}

drivers/hwmon/max6697.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ static const u8 MAX6697_REG_CRIT[] = {
3838
* Map device tree / platform data register bit map to chip bit map.
3939
* Applies to alert register and over-temperature register.
4040
*/
41-
#define MAX6697_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \
41+
#define MAX6697_ALERT_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \
4242
(((reg) & 0x01) << 6) | ((reg) & 0x80))
43+
#define MAX6697_OVERT_MAP_BITS(reg) (((reg) >> 1) | (((reg) & 0x01) << 7))
4344

4445
#define MAX6697_REG_STAT(n) (0x44 + (n))
4546

@@ -562,12 +563,12 @@ static int max6697_init_chip(struct max6697_data *data,
562563
return ret;
563564

564565
ret = i2c_smbus_write_byte_data(client, MAX6697_REG_ALERT_MASK,
565-
MAX6697_MAP_BITS(pdata->alert_mask));
566+
MAX6697_ALERT_MAP_BITS(pdata->alert_mask));
566567
if (ret < 0)
567568
return ret;
568569

569570
ret = i2c_smbus_write_byte_data(client, MAX6697_REG_OVERT_MASK,
570-
MAX6697_MAP_BITS(pdata->over_temperature_mask));
571+
MAX6697_OVERT_MAP_BITS(pdata->over_temperature_mask));
571572
if (ret < 0)
572573
return ret;
573574

drivers/hwmon/pmbus/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ config SENSORS_IR35221
7171
Infineon IR35221 controller.
7272

7373
This driver can also be built as a module. If so, the module will
74-
be called ir35521.
74+
be called ir35221.
7575

7676
config SENSORS_IR38064
7777
tristate "Infineon IR38064"

drivers/hwmon/pmbus/pmbus_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ static int pmbus_add_fan_ctrl(struct i2c_client *client,
18691869
struct pmbus_sensor *sensor;
18701870

18711871
sensor = pmbus_add_sensor(data, "fan", "target", index, page,
1872-
PMBUS_VIRT_FAN_TARGET_1 + id, 0xff, PSC_FAN,
1872+
0xff, PMBUS_VIRT_FAN_TARGET_1 + id, PSC_FAN,
18731873
false, false, true);
18741874

18751875
if (!sensor)
@@ -1880,14 +1880,14 @@ static int pmbus_add_fan_ctrl(struct i2c_client *client,
18801880
return 0;
18811881

18821882
sensor = pmbus_add_sensor(data, "pwm", NULL, index, page,
1883-
PMBUS_VIRT_PWM_1 + id, 0xff, PSC_PWM,
1883+
0xff, PMBUS_VIRT_PWM_1 + id, PSC_PWM,
18841884
false, false, true);
18851885

18861886
if (!sensor)
18871887
return -ENOMEM;
18881888

18891889
sensor = pmbus_add_sensor(data, "pwm", "enable", index, page,
1890-
PMBUS_VIRT_PWM_ENABLE_1 + id, 0xff, PSC_PWM,
1890+
0xff, PMBUS_VIRT_PWM_ENABLE_1 + id, PSC_PWM,
18911891
true, false, false);
18921892

18931893
if (!sensor)
@@ -1929,7 +1929,7 @@ static int pmbus_add_fan_attributes(struct i2c_client *client,
19291929
continue;
19301930

19311931
if (pmbus_add_sensor(data, "fan", "input", index,
1932-
page, pmbus_fan_registers[f], 0xff,
1932+
page, 0xff, pmbus_fan_registers[f],
19331933
PSC_FAN, true, true, true) == NULL)
19341934
return -ENOMEM;
19351935

0 commit comments

Comments
 (0)