From b9008708f24de8fb9bdbfb5d3b27e36d5a357eda Mon Sep 17 00:00:00 2001 From: Luca Tettamanti Date: Fri, 8 May 2009 20:27:28 +0200 Subject: [PATCH 1/2] hwmon: (asus_atk0110) Fix compiler warning atk_sensor_type is only used when DEBUG is defined. Signed-off-by: Luca Tettamanti Signed-off-by: Jean Delvare --- drivers/hwmon/asus_atk0110.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 0897edef25745..bff0103610c17 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -348,6 +348,7 @@ static int validate_hwmon_pack(struct atk_data *data, union acpi_object *obj) return 0; } +#ifdef DEBUG static char const *atk_sensor_type(union acpi_object *flags) { u64 type = flags->integer.value & ATK_TYPE_MASK; @@ -370,6 +371,7 @@ static char const *atk_sensor_type(union acpi_object *flags) return what; } +#endif static void atk_print_sensor(struct atk_data *data, union acpi_object *obj) { From 848ddf116b3d1711c956fac8627be12dfe8d736f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 8 May 2009 20:27:28 +0200 Subject: [PATCH 2/2] hwmon: (w83781d) Fix W83782D support (NULL pointer dereference) Commit 360782dde00a2e6e7d9fd57535f90934707ab8a8 (hwmon: (w83781d) Stop abusing struct i2c_client for ISA devices) broke W83782D support for devices connected on the ISA bus. You will hit a NULL pointer dereference as soon as you read any device attribute. Other devices, and W83782D devices on the SMBus, aren't affected. Reported-by: Michel Abraham Signed-off-by: Jean Delvare Tested-by: Michel Abraham --- drivers/hwmon/w83781d.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index dbfb30c588d8c..0bdab959b7369 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c @@ -1462,7 +1462,8 @@ static struct w83781d_data *w83781d_update_device(struct device *dev) data->pwm[i] = w83781d_read_value(data, W83781D_REG_PWM[i]); - if ((data->type != w83782d || !client->driver) + /* Only W83782D on SMBus has PWM3 and PWM4 */ + if ((data->type != w83782d || !client) && i == 1) break; }