]> git.hungrycats.org Git - linux/commitdiff
[PATCH] I2C: Bring lm75 and lm78 in compliance with sysfs naming conventions
authorJean Delvare <khali@linux-fr.org>
Tue, 27 Jan 2004 06:38:29 +0000 (22:38 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 27 Jan 2004 06:38:29 +0000 (22:38 -0800)
Here is a patch that brings the lm75 and lm78 drivers in compliance with
sysfs naming conventions. The drivers as found in existing 2.6 kernels
do not have a digit appended to the temperature-related files names as
the sysfs naming conversion recommends (obviously because they each have
a single temperature channel). As a result, libsensors won't find the
files.

It was discussed on the list wether a '1' should be appended in this
case, and our conclusion was that it would be better to do so because it
helps automatic processing of the sysfs exported files. Please apply if
you agree with this.

drivers/i2c/chips/lm75.c
drivers/i2c/chips/lm78.c

index 337f9a32b08e7ad498f119cd992a75adf6f16939..c1488261677ea09d44368098d10cdd0fab1bb69c 100644 (file)
@@ -104,9 +104,9 @@ static ssize_t set_##value(struct device *dev, const char *buf, size_t count)       \
 set(temp_max, LM75_REG_TEMP_OS);
 set(temp_hyst, LM75_REG_TEMP_HYST);
 
-static DEVICE_ATTR(temp_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
-static DEVICE_ATTR(temp_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst);
-static DEVICE_ATTR(temp_input, S_IRUGO, show_temp_input, NULL);
+static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
+static DEVICE_ATTR(temp_hyst1, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst);
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input, NULL);
 
 static int lm75_attach_adapter(struct i2c_adapter *adapter)
 {
@@ -197,9 +197,9 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
        lm75_init_client(new_client);
        
        /* Register sysfs hooks */
-       device_create_file(&new_client->dev, &dev_attr_temp_max);
-       device_create_file(&new_client->dev, &dev_attr_temp_hyst);
-       device_create_file(&new_client->dev, &dev_attr_temp_input);
+       device_create_file(&new_client->dev, &dev_attr_temp_max1);
+       device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
+       device_create_file(&new_client->dev, &dev_attr_temp_input1);
 
        return 0;
 
index f5925c28383332f27b96e10803365fc57a34b827..e33cd233234da2bf1929b1dc481fc298b128a1e4 100644 (file)
@@ -369,10 +369,10 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count)
        return count;
 }
 
-static DEVICE_ATTR(temp_input, S_IRUGO, show_temp, NULL)
-static DEVICE_ATTR(temp_max, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp, NULL)
+static DEVICE_ATTR(temp_max1, S_IRUGO | S_IWUSR,
                show_temp_over, set_temp_over)
-static DEVICE_ATTR(temp_hyst, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(temp_hyst1, S_IRUGO | S_IWUSR,
                show_temp_hyst, set_temp_hyst)
 
 /* 3 Fans */
@@ -678,9 +678,9 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
        device_create_file(&new_client->dev, &dev_attr_in_input6);
        device_create_file(&new_client->dev, &dev_attr_in_min6);
        device_create_file(&new_client->dev, &dev_attr_in_max6);
-       device_create_file(&new_client->dev, &dev_attr_temp_input);
-       device_create_file(&new_client->dev, &dev_attr_temp_max);
-       device_create_file(&new_client->dev, &dev_attr_temp_hyst);
+       device_create_file(&new_client->dev, &dev_attr_temp_input1);
+       device_create_file(&new_client->dev, &dev_attr_temp_max1);
+       device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
        device_create_file(&new_client->dev, &dev_attr_fan_input1);
        device_create_file(&new_client->dev, &dev_attr_fan_min1);
        device_create_file(&new_client->dev, &dev_attr_fan_div1);