]> err.no Git - linux-2.6/blobdiff - drivers/hwmon/w83793.c
scsi: use non-racy method for proc entries creation
[linux-2.6] / drivers / hwmon / w83793.c
index 6b5c99c9e8069f2be8b500458ae65d7c9ee3b7fb..ee35af93b574d37879acf53d813bd24f12c8dc29 100644 (file)
@@ -37,7 +37,8 @@
 #include <linux/mutex.h>
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END };
+static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
+                                               I2C_CLIENT_END };
 
 /* Insmod parameters */
 I2C_CLIENT_INSMOD_1(w83793);
@@ -243,9 +244,7 @@ static struct i2c_driver w83793_driver = {
 static ssize_t
 show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct i2c_client *client = to_i2c_client(dev);
-       struct w83793_data *data = i2c_get_clientdata(client);
-
+       struct w83793_data *data = dev_get_drvdata(dev);
        return sprintf(buf, "%d\n", data->vrm);
 }
 
@@ -264,9 +263,7 @@ static ssize_t
 store_vrm(struct device *dev, struct device_attribute *attr,
          const char *buf, size_t count)
 {
-       struct i2c_client *client = to_i2c_client(dev);
-       struct w83793_data *data = i2c_get_clientdata(client);
-
+       struct w83793_data *data = dev_get_drvdata(dev);
        data->vrm = simple_strtoul(buf, NULL, 10);
        return count;
 }