Skip to contentSkip to conversation

hwmon/f75375s.c: buggy if()

DISCUSSION Adrian Bunk 5 participants 16 messages Oct 17, 2007 – Nov 2, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

drivers/hwmon/f75375s.c contains the following code:

<-- snip -->

...
static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
...

        if (val != 0 || val != 1 || data->kind == f75373)
                return -EINVAL;

...

<-- snip -->

I'm not sure what exactly was intended, but it was for sure not intended to always return -EINVAL...

Spotted by the Coverity checker.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
maintainer
#1 lore raw
Quoted 7 lines

<-- snip -->

...
static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
...

Quoted 8 lines
        if (val != 0 || val != 1 || data->kind = f75373)
                return -EINVAL;

...

<-- snip -->

I'm not sure what exactly was intended, but it was for sure not intended to always return -EINVAL...

Aiee. val should be 1 or 0, and kind must not be f75373.

---
 drivers/hwmon/f75375s.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/f75375s.c +1 -1
index f1df57a..885bfe9 100644
@@ -344,7 +344,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
    int val = simple_strtoul(buf, NULL, 10);
    u8 conf = 0;
 
-   if (val != 0 || val != 1 || data->kind = f75373)
+   if (!(val = 0 || val = 1 ) || data->kind = f75373)
        return -EINVAL;
 
    mutex_lock(&data->update_lock);

--
1.5.3.1

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

#2 lore raw

Hi:

Quoted 37 lines · Riku Voipio
Quoted 7 lines

<-- snip -->

...
static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
...

Quoted 8 lines
        if (val != 0 || val != 1 || data->kind = f75373)
                return -EINVAL;

...

<-- snip -->

I'm not sure what exactly was intended, but it was for sure not intended to always return -EINVAL...

Aiee. val should be 1 or 0, and kind must not be f75373.

---
 drivers/hwmon/f75375s.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/f75375s.c +1 -2
index f1df57a..885bfe9 100644
@@ -344,7 +344,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
    int val = simple_strtoul(buf, NULL, 10);
    u8 conf = 0;
 
-   if (val != 0 || val != 1 || data->kind = f75373)
+   if (!(val = 0 || val = 1 ) || data->kind = f75373)
        return -EINVAL;
 
    mutex_lock(&data->update_lock);
--
Quoted 1 line

1.5.3.1

That patch doesn't apply here, so I applied this:

commit 805763cd743f2aed41dc61a55569fa43cf1f240c

Author: Riku Voipio <[email protected]>
Date:   Thu Oct 18 09:29:53 2007 -0400

hwmon: (f75375s) fix pwm mode setting

Spotted by the Coverity checker. (Thanks Adrian Bunk)

drivers/hwmon/f75375s.c +1 -1
index 13a0413..59a3470 100644
@@ -323,7 +323,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
 	int val = simple_strtoul(buf, NULL, 10);
 	u8 conf = 0;
 
-	if (val != 0 || val != 1 || data->kind = f75373)
+	if (!(val = 0 || val = 1) || data->kind = f75373)
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);

Thanks & regards,

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


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

Hi Mark, hi Riku,

Quoted 18 lines · Mark M. Hoffman

That patch doesn't apply here, so I applied this:

commit 805763cd743f2aed41dc61a55569fa43cf1f240c

Author: Riku Voipio <[email protected]>
Date:   Thu Oct 18 09:29:53 2007 -0400

hwmon: (f75375s) fix pwm mode setting

Spotted by the Coverity checker. (Thanks Adrian Bunk)

drivers/hwmon/f75375s.c +0 -0
index 13a0413..59a3470 100644

drivers/hwmon/f75375s.c static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr, · line 329

Quoted 8 lines
drivers/hwmon/f75375s.c +1 -1
@@ -323,7 +323,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
 	int val = simple_strtoul(buf, NULL, 10);
 	u8 conf = 0;
 
-	if (val != 0 || val != 1 || data->kind = f75373)
+	if (!(val = 0 || val = 1) || data->kind = f75373)
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);

BTW, that's the wrong way to do it. If the F75373S doesn't support changing the PWM mode, then the sysfs attribute in question should be read-only for this chip type. Making it writable and returning an error on write is confusing.

Riku, can you please submit a patch fixing this? The attribute should be declared read-only, and then you can use sysfs_chmod_file() to change it to read-write where supported. Take a look at the w83781d driver for an example.

Thanks,

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#4 lore raw
Quoted 3 lines · Jean Delvare

Riku, can you please submit a patch fixing this? The attribute should be declared read-only, and then you can use sysfs_chmod_file() to change it to read-write where supported.

Thanks, this was good suggestion. Patch attached.

Quoted 2 lines

Take a look at the w83781d
driver for an example.

Btw, I think your example code has a indentation bug:

		if (kind != w83781d)
			err = sysfs_chmod_file(&dev->kobj,
				&sensor_dev_attr_temp3_alarm.dev_attr.attr,
				S_IRUGO | S_IWUSR);
			if (err)
				return err;
Signature · 6 lines
"rm -rf" only sounds scary if you don't have backups

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

Hi Riku:

Quoted 6 lines · Riku Voipio
Quoted 3 lines · Jean Delvare

Riku, can you please submit a patch fixing this? The attribute should be declared read-only, and then you can use sysfs_chmod_file() to change it to read-write where supported.

Thanks, this was good suggestion. Patch attached.

No patch?

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


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#6 lore raw
Quoted 9 lines · Mark M. Hoffman
Quoted 6 lines · Riku Voipio
Quoted 3 lines · Jean Delvare

Riku, can you please submit a patch fixing this? The attribute should be declared read-only, and then you can use sysfs_chmod_file() to change it to read-write where supported.

Thanks, this was good suggestion. Patch attached.

No patch?

Let's try again..

Signature · 1 line
"rm -rf" only sounds scary if you don't have backups

From 90a98836377541819012dfea8bd1bf748cd39723 Mon Sep 17 00:00:00 2001
From: Riku Voipio <[email protected]>
Date: Mon, 22 Oct 2007 17:42:35 +0300
Subject: [PATCH] Fix hwmon/f75375s.c: buggy if()

Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant.

---
 drivers/hwmon/f75375s.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +16 -3
index 13a0413..d3b7932 100644
@@ -323,7 +323,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
 	int val = simple_strtoul(buf, NULL, 10);
 	u8 conf = 0;
 
-	if (val != 0 || val != 1 || data->kind == f75373)
+	if (!(val == 0 || val == 1))
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
@@ -529,13 +529,13 @@ static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR,
 	show_pwm, set_pwm, 0);
 static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR,
 	show_pwm_enable, set_pwm_enable, 0);
-static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO,
 	show_pwm_mode, set_pwm_mode, 0);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR,
 	show_pwm, set_pwm, 1);
 static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR,
 	show_pwm_enable, set_pwm_enable, 1);
-static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO,
 	show_pwm_mode, set_pwm_mode, 1);
 
 static struct attribute *f75375_attributes[] = {
@@ -655,6 +655,19 @@ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
 	if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
 		goto exit_detach;
 
+	if (kind == f75375) {
+		err = sysfs_chmod_file(&client->dev.kobj,
+			&sensor_dev_attr_pwm1_mode.dev_attr.attr,
+			S_IRUGO | S_IWUSR);
+		if (err)
+			goto exit_detach;
+		err = sysfs_chmod_file(&client->dev.kobj,
+			&sensor_dev_attr_pwm2_mode.dev_attr.attr,
+			S_IRUGO | S_IWUSR);
+		if (err)
+			goto exit_detach;
+	}
+
 	data->hwmon_dev = hwmon_device_register(&client->dev);
 	if (IS_ERR(data->hwmon_dev)) {
 		err = PTR_ERR(data->hwmon_dev);
Signature · 1 line
1.5.3.1

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

#7 lore raw

Hi Riku,

Quoted 61 lines · Riku Voipio
Quoted 9 lines · Mark M. Hoffman
Quoted 6 lines · Riku Voipio
Quoted 3 lines · Jean Delvare

Riku, can you please submit a patch fixing this? The attribute should be declared read-only, and then you can use sysfs_chmod_file() to change it to read-write where supported.

Thanks, this was good suggestion. Patch attached.

No patch?

Let's try again..

Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant.

---
 drivers/hwmon/f75375s.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +9 -3
index 13a0413..d3b7932 100644
@@ -323,7 +323,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
 	int val = simple_strtoul(buf, NULL, 10);
 	u8 conf = 0;
 
-	if (val != 0 || val != 1 || data->kind = f75373)
+	if (!(val = 0 || val = 1))
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
@@ -529,13 +529,13 @@ static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR,
 	show_pwm, set_pwm, 0);
 static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR,
 	show_pwm_enable, set_pwm_enable, 0);
-static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO,
 	show_pwm_mode, set_pwm_mode, 0);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR,
 	show_pwm, set_pwm, 1);
 static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR,
 	show_pwm_enable, set_pwm_enable, 1);
-static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO,
 	show_pwm_mode, set_pwm_mode, 1);
 
 static struct attribute *f75375_attributes[] = {
@@ -655,6 +655,19 @@ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
 	if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
 		goto exit_detach;
 
+	if (kind = f75375) {
+		err = sysfs_chmod_file(&client->dev.kobj,
+			&sensor_dev_attr_pwm1_mode.dev_attr.attr,
+			S_IRUGO | S_IWUSR);
+		if (err)
+			goto exit_detach;

drivers/hwmon/f75375s.c static int f75375_detect(struct i2c_adapter *adapter, int address, int kind) · line 673

Quoted 10 lines
drivers/hwmon/f75375s.c +7 -0
+		err = sysfs_chmod_file(&client->dev.kobj,
+			&sensor_dev_attr_pwm2_mode.dev_attr.attr,
+			S_IRUGO | S_IWUSR);
+		if (err)
+			goto exit_detach;
+	}
+
 	data->hwmon_dev = hwmon_device_register(&client->dev);
 	if (IS_ERR(data->hwmon_dev)) {
 		err = PTR_ERR(data->hwmon_dev);

Patch looks correct, however it doesn't apply on top of Mark's tree. I was able to get it to apply by reverting "(f75375s) fix pwm mode setting" first, but then the build fails. Presumably the other f75375s patches interact badly. Can you please respin this patch on top of Mark's tree (i.e. on top the the 4 other f75375s patches you sent since the -rc1 merge)? Thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#8 lore raw
Quoted 6 lines · Jean Delvare

Patch looks correct, however it doesn't apply on top of Mark's tree. I was able to get it to apply by reverting "(f75375s) fix pwm mode setting" first, but then the build fails. Presumably the other f75375s patches interact badly. Can you please respin this patch on top of Mark's tree (i.e. on top the the 4 other f75375s patches you sent since the -rc1 merge)? Thanks.

The surrounding code had wandered to another function, so it's suprising it applied at all. Here's respin.

Signature · 1 line
"rm -rf" only sounds scary if you don't have backups

From 4de69e3ab5b5833cddb503f0dcb2a3ccc2d5b328 Mon Sep 17 00:00:00 2001
From: Riku Voipio <[email protected]>
Date: Fri, 26 Oct 2007 13:53:50 +0300
Subject: [PATCH] hwmon (f75375s) fix buggy if() properly

Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant.

---
 drivers/hwmon/f75375s.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +16 -3
index 472b052..6892f76 100644
@@ -343,7 +343,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
 	int val = simple_strtoul(buf, NULL, 10);
 	u8 conf = 0;
 
-	if (!(val == 0 || val == 1) || data->kind == f75373)
+	if (!(val == 0 || val == 1))
 		return -EINVAL;
 
 	mutex_lock(&data->update_lock);
@@ -549,13 +549,13 @@ static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR,
 	show_pwm, set_pwm, 0);
 static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR,
 	show_pwm_enable, set_pwm_enable, 0);
-static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO,
 	show_pwm_mode, set_pwm_mode, 0);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR,
 	show_pwm, set_pwm, 1);
 static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR,
 	show_pwm_enable, set_pwm_enable, 1);
-static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO|S_IWUSR,
+static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO,
 	show_pwm_mode, set_pwm_mode, 1);
 
 static struct attribute *f75375_attributes[] = {
@@ -656,6 +656,19 @@ static int f75375_probe(struct i2c_client *client)
 	if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
 		goto exit_free;
 
+	if (data->kind == f75375) {
+		err = sysfs_chmod_file(&client->dev.kobj,
+			&sensor_dev_attr_pwm1_mode.dev_attr.attr,
+			S_IRUGO | S_IWUSR);
+		if (err)
+			goto exit_remove;
+		err = sysfs_chmod_file(&client->dev.kobj,
+			&sensor_dev_attr_pwm2_mode.dev_attr.attr,
+			S_IRUGO | S_IWUSR);
+		if (err)
+			goto exit_remove;
+	}
+
 	data->hwmon_dev = hwmon_device_register(&client->dev);
 	if (IS_ERR(data->hwmon_dev)) {
 		err = PTR_ERR(data->hwmon_dev);
Signature · 1 line
1.5.3.1

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

Acked-by
#9 lore raw
Quoted 10 lines · Riku Voipio
Quoted 6 lines · Jean Delvare

Patch looks correct, however it doesn't apply on top of Mark's tree. I was able to get it to apply by reverting "(f75375s) fix pwm mode setting" first, but then the build fails. Presumably the other f75375s patches interact badly. Can you please respin this patch on top of Mark's tree (i.e. on top the the 4 other f75375s patches you sent since the -rc1 merge)? Thanks.

The surrounding code had wandered to another function, so it's suprising it applied at all. Here's respin.

Patch looks OK, thanks.

Riku, I have 14 patches posted to the lm-sensors list pending for review. Would you mind reviewing one of them? Thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#10 lore raw
In reply to Riku Voipio

Hi:

Quoted 8 lines · Riku Voipio
Quoted 6 lines · Jean Delvare

Patch looks correct, however it doesn't apply on top of Mark's tree. I was able to get it to apply by reverting "(f75375s) fix pwm mode setting" first, but then the build fails. Presumably the other f75375s patches interact badly. Can you please respin this patch on top of Mark's tree (i.e. on top the the 4 other f75375s patches you sent since the -rc1 merge)? Thanks.

Quoted 20 lines

The surrounding code had wandered to another function, so it's suprising it applied at all. Here's respin.

Signature · 1 line
"rm -rf" only sounds scary if you don't have backups
Quoted 1 line

From 4de69e3ab5b5833cddb503f0dcb2a3ccc2d5b328 Mon Sep 17 00:00:00 2001

From: Riku Voipio <[email protected]>
Date: Fri, 26 Oct 2007 13:53:50 +0300
Subject: [PATCH] hwmon (f75375s) fix buggy if() properly

Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant.

---
 drivers/hwmon/f75375s.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 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
#11 lore raw
In reply to Riku Voipio

Hi Riku,

Quoted 4 lines · Riku Voipio
Quoted 2 lines · Jean Delvare

Take a look at the w83781d
driver for an example.

Quoted 8 lines

Btw, I think your example code has a indentation bug:

		if (kind != w83781d)
			err = sysfs_chmod_file(&dev->kobj,
				&sensor_dev_attr_temp3_alarm.dev_attr.attr,
				S_IRUGO | S_IWUSR);
			if (err)
				return err;

Indentation is correct, but curly braces are missing! Nice catch, thanks for reporting. It happens to be harmless in this specific case, but it still needs fixing. I'll submit a patch shortly.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#12 lore raw
In reply to Adrian Bunk
Quoted 9 lines · Jean Delvare
Quoted 2 lines

The surrounding code had wandered to another function, so it's suprising it applied at all. Here's respin.

Patch looks OK, thanks.

Riku, I have 14 patches posted to the lm-sensors list pending for review. Would you mind reviewing one of them? Thanks.

Sure. I reviewed just a obvious one. I'll look at reviewing something more complicated on monday. Apart from the fintek, I have currently it87 and k8temp sensors to test, so any patches agains against those would be preferred.

Signature · 6 lines
"rm -rf" only sounds scary if you don't have backups

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#13 lore raw
In reply to Adrian Bunk
Quoted 4 lines · Riku Voipio

Sure. I reviewed just a obvious one. I'll look at reviewing something more complicated on monday. Apart from the fintek, I have currently it87 and k8temp sensors to test, so any patches agains against those would be preferred.

Well, the it87 driver needs to be modified to create individual alarm files. You could work on this if you want, that would be pretty helpful.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#14 lore raw
In reply to Adrian Bunk

Hi

Quoted 26 lines

Hi:

Quoted 23 lines · Riku Voipio
Quoted 6 lines · Jean Delvare

Patch looks correct, however it doesn't apply on top of Mark's tree. I was able to get it to apply by reverting "(f75375s) fix pwm mode setting" first, but then the build fails. Presumably the other f75375s patches interact badly. Can you please respin this patch on top of Mark's tree (i.e. on top the the 4 other f75375s patches you sent since the -rc1 merge)? Thanks.

The surrounding code had wandered to another function, so it's suprising it applied at all. Here's respin.

Signature · 1 line
"rm -rf" only sounds scary if you don't have backups
Quoted 1 line

From 4de69e3ab5b5833cddb503f0dcb2a3ccc2d5b328 Mon Sep 17 00:00:00 > 2001

From: Riku Voipio
Date: Fri, 26 Oct 2007 13:53:50 +0300
Subject: [PATCH] hwmon (f75375s) fix buggy if() properly

Fix value check in set_pwm_mode(). Instead of checking for chip variant there, make pwmX_mode sysfs nodes only writable on f75375 variant.

Quoted 11 lines
Quoted 5 lines
Signed-off-by Riku Voipio
---
 drivers/hwmon/f75375s.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

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

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

Don't know if necessary, but i tested the driver using kernel 2.6.22-14, driver from kernel/mhoffman/hwmon-2.6.git - testing (28 Oct) and sensors version 3.0.0-rc3 with libsensors version 3.0.0-rc3.

Fan-Speed, temperatures and voltage is displayed correctly. I can also change the fan speed without problem.
The only modification i made in lm-sensors, setting the value of driver to "f75375s" in prog/detect/sensors-detect for "Fintek F75373S/SG".

best regards
christian.

---------------------------------
Ihr erstes Fernweh? Wo gibt es den schönsten Strand.

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

#15 lore raw
In reply to Adrian Bunk

Hi Christian,

Quoted 3 lines · Christian Emmerich

The only modification i made in lm-sensors, setting the value of driver to "f75375s" in prog/detect/sensors-detect for "Fintek F75373S/SG".

Good catch, this was somehow overlooked. I just fixed it in SVN, thanks for reporting.

Signature · 6 lines
Jean Delvare

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