Commit 6f5738db authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hwmon-for-v5.17-rc6' of...

Merge tag 'hwmon-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
 "Fix two old bugs and one new bug in the hwmon subsystem:

   - In pmbus core, clear pmbus fault/warning status bits after read to
     follow PMBus standard

   - In hwmon core, handle failure to register sensor with thermal zone
     correctly

   - In ntc_thermal driver, use valid thermistor names for Samsung
     thermistors"

* tag 'hwmon-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (pmbus) Clear pmbus fault/warning bits after read
  hwmon: Handle failure to register sensor with thermal zone correctly
  hwmon: (ntc_thermistor) Underscore Samsung thermistor
parents 4eb0a7c8 35f165f0
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -214,12 +214,14 @@ static int hwmon_thermal_add_sensor(struct device *dev, int index)


	tzd = devm_thermal_zone_of_sensor_register(dev, index, tdata,
	tzd = devm_thermal_zone_of_sensor_register(dev, index, tdata,
						   &hwmon_thermal_ops);
						   &hwmon_thermal_ops);
	/*
	if (IS_ERR(tzd)) {
	 * If CONFIG_THERMAL_OF is disabled, this returns -ENODEV,
		if (PTR_ERR(tzd) != -ENODEV)
	 * so ignore that error but forward any other error.
	 */
	if (IS_ERR(tzd) && (PTR_ERR(tzd) != -ENODEV))
			return PTR_ERR(tzd);
			return PTR_ERR(tzd);
		dev_info(dev, "temp%d_input not attached to any thermal zone\n",
			 index + 1);
		devm_kfree(dev, tdata);
		return 0;
	}


	err = devm_add_action(dev, hwmon_thermal_remove_sensor, &tdata->node);
	err = devm_add_action(dev, hwmon_thermal_remove_sensor, &tdata->node);
	if (err)
	if (err)
+1 −1
Original line number Original line Diff line number Diff line
@@ -59,7 +59,7 @@ static const struct platform_device_id ntc_thermistor_id[] = {
	[NTC_NCP15XH103]      = { "ncp15xh103",      TYPE_NCPXXXH103 },
	[NTC_NCP15XH103]      = { "ncp15xh103",      TYPE_NCPXXXH103 },
	[NTC_NCP18WB473]      = { "ncp18wb473",      TYPE_NCPXXWB473 },
	[NTC_NCP18WB473]      = { "ncp18wb473",      TYPE_NCPXXWB473 },
	[NTC_NCP21WB473]      = { "ncp21wb473",      TYPE_NCPXXWB473 },
	[NTC_NCP21WB473]      = { "ncp21wb473",      TYPE_NCPXXWB473 },
	[NTC_SSG1404001221]   = { "ssg1404-001221",  TYPE_NCPXXWB473 },
	[NTC_SSG1404001221]   = { "ssg1404_001221",  TYPE_NCPXXWB473 },
	[NTC_LAST]            = { },
	[NTC_LAST]            = { },
};
};


+5 −0
Original line number Original line Diff line number Diff line
@@ -911,6 +911,11 @@ static int pmbus_get_boolean(struct i2c_client *client, struct pmbus_boolean *b,
		pmbus_update_sensor_data(client, s2);
		pmbus_update_sensor_data(client, s2);


	regval = status & mask;
	regval = status & mask;
	if (regval) {
		ret = pmbus_write_byte_data(client, page, reg, regval);
		if (ret)
			goto unlock;
	}
	if (s1 && s2) {
	if (s1 && s2) {
		s64 v1, v2;
		s64 v1, v2;