Skip to contentSkip to conversation

hwmon/thmc50: Don't create temp3 if not enabled

PATCH In review Jean Delvare 3 participants 3 messages Sep 18, 2007 – Oct 7, 2007 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon/thmc50: Don't create temp3 if not enabled

---
 drivers/hwmon/thmc50.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/hwmon/thmc50.c +9 -9
@@ -237,7 +237,7 @@ static const struct attribute_group thmc
 };
 
 /* for ADM1022 3rd temperature mode */
-static struct attribute *adm1022_attributes[] = {
+static struct attribute *temp3_attributes[] = {
 	&sensor_dev_attr_temp3_max.dev_attr.attr,
 	&sensor_dev_attr_temp3_min.dev_attr.attr,
 	&sensor_dev_attr_temp3_input.dev_attr.attr,
@@ -246,8 +246,8 @@ static struct attribute *adm1022_attribu
 	NULL
 };
 
-static const struct attribute_group adm1022_group = {
-	.attrs = adm1022_attributes,
+static const struct attribute_group temp3_group = {
+	.attrs = temp3_attributes,
 };
 
 static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
@@ -345,9 +345,9 @@ static int thmc50_detect(struct i2c_adap
 		goto exit_detach;
 
 	/* Register ADM1022 sysfs hooks */
-	if (data->type = adm1022)
+	if (data->has_temp3)
 		if ((err = sysfs_create_group(&client->dev.kobj,
-					      &adm1022_group)))
+					      &temp3_group)))
 			goto exit_remove_sysfs_thmc50;
 
 	/* Register a new directory entry with module sensors */
@@ -360,8 +360,8 @@ static int thmc50_detect(struct i2c_adap
 	return 0;
 
 exit_remove_sysfs:
-	if (data->type = adm1022)
-		sysfs_remove_group(&client->dev.kobj, &adm1022_group);
+	if (data->has_temp3)
+		sysfs_remove_group(&client->dev.kobj, &temp3_group);
 exit_remove_sysfs_thmc50:
 	sysfs_remove_group(&client->dev.kobj, &thmc50_group);
 exit_detach:
@@ -386,8 +386,8 @@ static int thmc50_detach_client(struct i
 
 	hwmon_device_unregister(data->hwmon_dev);
 	sysfs_remove_group(&client->dev.kobj, &thmc50_group);
-	if (data->type = adm1022)
-		sysfs_remove_group(&client->dev.kobj, &adm1022_group);
+	if (data->has_temp3)
+		sysfs_remove_group(&client->dev.kobj, &temp3_group);
 
 	if ((err = i2c_detach_client(client)))
 		return err;
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Re: [lm-sensors] [PATCH] hwmon/thmc50: Don't create temp3 if not

Quoted 3 lines · On Tue, 18 Sep 2007 18:44:42 +0200 Jean Delvare <[email protected]> wrote:

---

The patch is already reviewed and tested.

----------------------------------------------------------------------
Fajne i smieszne. Zobacz najlepsze filmiki!

Quoted 1 line
Quoted 1 line
Quoted 1 line

http://link.interia.pl/f1bbb

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw

Re: [lm-sensors] [PATCH] hwmon/thmc50: Don't create temp3 if not

In reply to Jean Delvare

Hi:

Quoted 5 lines · Jean Delvare
---
 drivers/hwmon/thmc50.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Applied to hwmon-2.6.git/testing, thanks.

Signature · 8 lines
Mark M. Hoffman
[email protected]


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors