hwmon fixes for v4.4-rc2

Fix build issues in scpi and ina2xx drivers, update scpi driver to
 support recent firmware, and fix an uninitialized variable warning
 in applesmc driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWTKdFAAoJEMsfJm/On5mBOVQP/RUuwr/ugCSxX4FalU6CdUoW
 bKmtTKNQhSFtY/4w+hOzqcJu0WcpLA8CbHkwG8bB3wZqEcHMASzd9ajNZb1vVh5v
 Aj61PCJTelv36w7Nt6NZ2dkymYSjkW72YPAt+dzMIn7HIJ2cxjJtvUdH87BE9rDq
 oGeIQ246z5ytXNJvl/MHRHGrf3RXMPrsTcTvvPMXWZovUD4x+HQ1CvYY5VGPYA8N
 dhOZGwy3S6/WOnSnKqUxLJCNj/Bi/GyXWHAzLKLl9dGeUp3wbrWJnve1uLNMwSS3
 w7ImPKkYGsUN2Z2uJHiyW967gXjpfVav1545eaP/Co52tzIeAbvyXU0EacjM0fU0
 UQ4MMyFglNrBJd1yDiVeZQsjeHfqOMVDJFwF6UIXFuKWx5R4RlEe0R5YKf4oBNtK
 4ad+n2kHnEGQFdWwirbeiwCBEB6M7Vrv58OZypJRmYxkfgR8x77Tq8tceCPYf6g4
 fimcWRr4uuTKooQyhHDrej+/2RFH0acvw2xwypjWj2FkBwV045ZvDogY8syPIB+0
 1BJs40ZlV6WXaffHHco//ZLXtOgZ62UKHkLng9knMBjAcKmkPbn4+amym/Y18yVr
 fTVBt8iiCIVhtXIAHG34fvUDec3EyjYgc2FvtpuHqb2vUF6T75xOzxvpDW5fgYQo
 tttvfy8fKOUyF+4aanMf
 =JYMV
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus-v4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
 "Fix build issues in scpi and ina2xx drivers, update scpi driver to
  support recent firmware, and fix an uninitialized variable warning in
  applesmc driver"

* tag 'hwmon-for-linus-v4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (scpi) skip unsupported sensors properly
  hwmon: (scpi) add thermal-of dependency
  hwmon : (applesmc) Fix uninitialized variables warnings
  hwmon: (ina2xx) Fix build issue by selecting REGMAP_I2C
This commit is contained in:
Linus Torvalds 2015-11-18 08:43:29 -08:00
commit 0d77a123ff
3 changed files with 14 additions and 11 deletions

View File

@ -324,6 +324,7 @@ config SENSORS_APPLESMC
config SENSORS_ARM_SCPI
tristate "ARM SCPI Sensors"
depends on ARM_SCPI_PROTOCOL
depends on THERMAL || !THERMAL_OF
help
This driver provides support for temperature, voltage, current
and power sensors available on ARM Ltd's SCP based platforms. The
@ -1471,6 +1472,7 @@ config SENSORS_INA209
config SENSORS_INA2XX
tristate "Texas Instruments INA219 and compatibles"
depends on I2C
select REGMAP_I2C
help
If you say yes here you get support for INA219, INA220, INA226,
INA230, and INA231 power monitor chips.

View File

@ -537,7 +537,7 @@ static int applesmc_init_index(struct applesmc_registers *s)
static int applesmc_init_smcreg_try(void)
{
struct applesmc_registers *s = &smcreg;
bool left_light_sensor, right_light_sensor;
bool left_light_sensor = 0, right_light_sensor = 0;
unsigned int count;
u8 tmp[1];
int ret;

View File

@ -117,7 +117,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
struct scpi_ops *scpi_ops;
struct device *hwdev, *dev = &pdev->dev;
struct scpi_sensors *scpi_sensors;
int ret;
int ret, idx;
scpi_ops = get_scpi_ops();
if (!scpi_ops)
@ -146,8 +146,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
scpi_sensors->scpi_ops = scpi_ops;
for (i = 0; i < nr_sensors; i++) {
struct sensor_data *sensor = &scpi_sensors->data[i];
for (i = 0, idx = 0; i < nr_sensors; i++) {
struct sensor_data *sensor = &scpi_sensors->data[idx];
ret = scpi_ops->sensor_get_info(i, &sensor->info);
if (ret)
@ -183,7 +183,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
num_power++;
break;
default:
break;
continue;
}
sensor->dev_attr_input.attr.mode = S_IRUGO;
@ -194,11 +194,12 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
sensor->dev_attr_label.show = scpi_show_label;
sensor->dev_attr_label.attr.name = sensor->label;
scpi_sensors->attrs[i << 1] = &sensor->dev_attr_input.attr;
scpi_sensors->attrs[(i << 1) + 1] = &sensor->dev_attr_label.attr;
scpi_sensors->attrs[idx << 1] = &sensor->dev_attr_input.attr;
scpi_sensors->attrs[(idx << 1) + 1] = &sensor->dev_attr_label.attr;
sysfs_attr_init(scpi_sensors->attrs[i << 1]);
sysfs_attr_init(scpi_sensors->attrs[(i << 1) + 1]);
sysfs_attr_init(scpi_sensors->attrs[idx << 1]);
sysfs_attr_init(scpi_sensors->attrs[(idx << 1) + 1]);
idx++;
}
scpi_sensors->group.attrs = scpi_sensors->attrs;
@ -236,8 +237,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
zone->sensor_id = i;
zone->scpi_sensors = scpi_sensors;
zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
&scpi_sensor_ops);
zone->tzd = thermal_zone_of_sensor_register(dev,
sensor->info.sensor_id, zone, &scpi_sensor_ops);
/*
* The call to thermal_zone_of_sensor_register returns
* an error for sensors that are not associated with