diff options
Diffstat (limited to 'drivers/hwmon/asb100.c')
-rw-r--r-- | drivers/hwmon/asb100.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index 57b1c7b7ac3f..9460dba4cf74 100644 --- a/drivers/hwmon/asb100.c +++ b/drivers/hwmon/asb100.c | |||
@@ -143,7 +143,7 @@ static int FAN_FROM_REG(u8 val, int div) | |||
143 | 143 | ||
144 | /* TEMP: 0.001C/bit (-128C to +127C) | 144 | /* TEMP: 0.001C/bit (-128C to +127C) |
145 | REG: 1C/bit, two's complement */ | 145 | REG: 1C/bit, two's complement */ |
146 | static u8 TEMP_TO_REG(int temp) | 146 | static u8 TEMP_TO_REG(long temp) |
147 | { | 147 | { |
148 | int ntemp = SENSORS_LIMIT(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX); | 148 | int ntemp = SENSORS_LIMIT(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX); |
149 | ntemp += (ntemp<0 ? -500 : 500); | 149 | ntemp += (ntemp<0 ? -500 : 500); |
@@ -182,7 +182,7 @@ static u8 DIV_TO_REG(long val) | |||
182 | dynamically allocated, at the same time the client itself is allocated. */ | 182 | dynamically allocated, at the same time the client itself is allocated. */ |
183 | struct asb100_data { | 183 | struct asb100_data { |
184 | struct i2c_client client; | 184 | struct i2c_client client; |
185 | struct class_device *class_dev; | 185 | struct device *hwmon_dev; |
186 | struct mutex lock; | 186 | struct mutex lock; |
187 | enum chips type; | 187 | enum chips type; |
188 | 188 | ||
@@ -448,7 +448,7 @@ static ssize_t set_##reg(struct device *dev, const char *buf, \ | |||
448 | { \ | 448 | { \ |
449 | struct i2c_client *client = to_i2c_client(dev); \ | 449 | struct i2c_client *client = to_i2c_client(dev); \ |
450 | struct asb100_data *data = i2c_get_clientdata(client); \ | 450 | struct asb100_data *data = i2c_get_clientdata(client); \ |
451 | unsigned long val = simple_strtoul(buf, NULL, 10); \ | 451 | long val = simple_strtol(buf, NULL, 10); \ |
452 | \ | 452 | \ |
453 | mutex_lock(&data->update_lock); \ | 453 | mutex_lock(&data->update_lock); \ |
454 | switch (nr) { \ | 454 | switch (nr) { \ |
@@ -514,7 +514,7 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); | |||
514 | /* VRM */ | 514 | /* VRM */ |
515 | static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) | 515 | static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) |
516 | { | 516 | { |
517 | struct asb100_data *data = asb100_update_device(dev); | 517 | struct asb100_data *data = dev_get_drvdata(dev); |
518 | return sprintf(buf, "%d\n", data->vrm); | 518 | return sprintf(buf, "%d\n", data->vrm); |
519 | } | 519 | } |
520 | 520 | ||
@@ -844,9 +844,9 @@ static int asb100_detect(struct i2c_adapter *adapter, int address, int kind) | |||
844 | if ((err = sysfs_create_group(&new_client->dev.kobj, &asb100_group))) | 844 | if ((err = sysfs_create_group(&new_client->dev.kobj, &asb100_group))) |
845 | goto ERROR3; | 845 | goto ERROR3; |
846 | 846 | ||
847 | data->class_dev = hwmon_device_register(&new_client->dev); | 847 | data->hwmon_dev = hwmon_device_register(&new_client->dev); |
848 | if (IS_ERR(data->class_dev)) { | 848 | if (IS_ERR(data->hwmon_dev)) { |
849 | err = PTR_ERR(data->class_dev); | 849 | err = PTR_ERR(data->hwmon_dev); |
850 | goto ERROR4; | 850 | goto ERROR4; |
851 | } | 851 | } |
852 | 852 | ||
@@ -874,7 +874,7 @@ static int asb100_detach_client(struct i2c_client *client) | |||
874 | 874 | ||
875 | /* main client */ | 875 | /* main client */ |
876 | if (data) { | 876 | if (data) { |
877 | hwmon_device_unregister(data->class_dev); | 877 | hwmon_device_unregister(data->hwmon_dev); |
878 | sysfs_remove_group(&client->dev.kobj, &asb100_group); | 878 | sysfs_remove_group(&client->dev.kobj, &asb100_group); |
879 | } | 879 | } |
880 | 880 | ||