diff options
Diffstat (limited to 'drivers/hwmon/lm85.c')
| -rw-r--r-- | drivers/hwmon/lm85.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index ab214df9624b..d1070ed2bee6 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c | |||
| @@ -1007,14 +1007,14 @@ temp_auto(1); | |||
| 1007 | temp_auto(2); | 1007 | temp_auto(2); |
| 1008 | temp_auto(3); | 1008 | temp_auto(3); |
| 1009 | 1009 | ||
| 1010 | int lm85_attach_adapter(struct i2c_adapter *adapter) | 1010 | static int lm85_attach_adapter(struct i2c_adapter *adapter) |
| 1011 | { | 1011 | { |
| 1012 | if (!(adapter->class & I2C_CLASS_HWMON)) | 1012 | if (!(adapter->class & I2C_CLASS_HWMON)) |
| 1013 | return 0; | 1013 | return 0; |
| 1014 | return i2c_probe(adapter, &addr_data, lm85_detect); | 1014 | return i2c_probe(adapter, &addr_data, lm85_detect); |
| 1015 | } | 1015 | } |
| 1016 | 1016 | ||
| 1017 | int lm85_detect(struct i2c_adapter *adapter, int address, | 1017 | static int lm85_detect(struct i2c_adapter *adapter, int address, |
| 1018 | int kind) | 1018 | int kind) |
| 1019 | { | 1019 | { |
| 1020 | int company, verstep ; | 1020 | int company, verstep ; |
| @@ -1033,11 +1033,10 @@ int lm85_detect(struct i2c_adapter *adapter, int address, | |||
| 1033 | client structure, even though we cannot fill it completely yet. | 1033 | client structure, even though we cannot fill it completely yet. |
| 1034 | But it allows us to access lm85_{read,write}_value. */ | 1034 | But it allows us to access lm85_{read,write}_value. */ |
| 1035 | 1035 | ||
| 1036 | if (!(data = kmalloc(sizeof(struct lm85_data), GFP_KERNEL))) { | 1036 | if (!(data = kzalloc(sizeof(struct lm85_data), GFP_KERNEL))) { |
| 1037 | err = -ENOMEM; | 1037 | err = -ENOMEM; |
| 1038 | goto ERROR0; | 1038 | goto ERROR0; |
| 1039 | } | 1039 | } |
| 1040 | memset(data, 0, sizeof(struct lm85_data)); | ||
| 1041 | 1040 | ||
| 1042 | new_client = &data->client; | 1041 | new_client = &data->client; |
| 1043 | i2c_set_clientdata(new_client, data); | 1042 | i2c_set_clientdata(new_client, data); |
| @@ -1236,7 +1235,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address, | |||
| 1236 | return err; | 1235 | return err; |
| 1237 | } | 1236 | } |
| 1238 | 1237 | ||
| 1239 | int lm85_detach_client(struct i2c_client *client) | 1238 | static int lm85_detach_client(struct i2c_client *client) |
| 1240 | { | 1239 | { |
| 1241 | struct lm85_data *data = i2c_get_clientdata(client); | 1240 | struct lm85_data *data = i2c_get_clientdata(client); |
| 1242 | hwmon_device_unregister(data->class_dev); | 1241 | hwmon_device_unregister(data->class_dev); |
| @@ -1246,7 +1245,7 @@ int lm85_detach_client(struct i2c_client *client) | |||
| 1246 | } | 1245 | } |
| 1247 | 1246 | ||
| 1248 | 1247 | ||
| 1249 | int lm85_read_value(struct i2c_client *client, u8 reg) | 1248 | static int lm85_read_value(struct i2c_client *client, u8 reg) |
| 1250 | { | 1249 | { |
| 1251 | int res; | 1250 | int res; |
| 1252 | 1251 | ||
| @@ -1276,7 +1275,7 @@ int lm85_read_value(struct i2c_client *client, u8 reg) | |||
| 1276 | return res ; | 1275 | return res ; |
| 1277 | } | 1276 | } |
| 1278 | 1277 | ||
| 1279 | int lm85_write_value(struct i2c_client *client, u8 reg, int value) | 1278 | static int lm85_write_value(struct i2c_client *client, u8 reg, int value) |
| 1280 | { | 1279 | { |
| 1281 | int res ; | 1280 | int res ; |
| 1282 | 1281 | ||
| @@ -1305,7 +1304,7 @@ int lm85_write_value(struct i2c_client *client, u8 reg, int value) | |||
| 1305 | return res ; | 1304 | return res ; |
| 1306 | } | 1305 | } |
| 1307 | 1306 | ||
| 1308 | void lm85_init_client(struct i2c_client *client) | 1307 | static void lm85_init_client(struct i2c_client *client) |
| 1309 | { | 1308 | { |
| 1310 | int value; | 1309 | int value; |
| 1311 | struct lm85_data *data = i2c_get_clientdata(client); | 1310 | struct lm85_data *data = i2c_get_clientdata(client); |
