diff options
author | Jean Delvare <jdelvare@suse.de> | 2014-04-04 12:01:34 -0400 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2014-04-04 12:01:34 -0400 |
commit | 5b58157598f93089ccda90aabd98f27865b344da (patch) | |
tree | 2b933cd00cefacb4a45b6a64decd7b381ab4b54c /drivers/hwmon | |
parent | 118c9a61f158c8f2e3694ed2a3681c217328a2c1 (diff) |
hwmon: (pc87360) Avoid initializing the same field twice
data is kzalloc'd, so data->valid, data->innr and data->tempnr are
already 0. Also rework the initialization path to only set name and
data->fannr once.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pc87360.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c index 330fe117e219..988181e4cfcd 100644 --- a/drivers/hwmon/pc87360.c +++ b/drivers/hwmon/pc87360.c | |||
@@ -1225,7 +1225,7 @@ static int pc87360_probe(struct platform_device *pdev) | |||
1225 | int i; | 1225 | int i; |
1226 | struct pc87360_data *data; | 1226 | struct pc87360_data *data; |
1227 | int err = 0; | 1227 | int err = 0; |
1228 | const char *name = "pc87360"; | 1228 | const char *name; |
1229 | int use_thermistors = 0; | 1229 | int use_thermistors = 0; |
1230 | struct device *dev = &pdev->dev; | 1230 | struct device *dev = &pdev->dev; |
1231 | 1231 | ||
@@ -1233,13 +1233,14 @@ static int pc87360_probe(struct platform_device *pdev) | |||
1233 | if (!data) | 1233 | if (!data) |
1234 | return -ENOMEM; | 1234 | return -ENOMEM; |
1235 | 1235 | ||
1236 | data->fannr = 2; | ||
1237 | data->innr = 0; | ||
1238 | data->tempnr = 0; | ||
1239 | |||
1240 | switch (devid) { | 1236 | switch (devid) { |
1237 | default: | ||
1238 | name = "pc87360"; | ||
1239 | data->fannr = 2; | ||
1240 | break; | ||
1241 | case 0xe8: | 1241 | case 0xe8: |
1242 | name = "pc87363"; | 1242 | name = "pc87363"; |
1243 | data->fannr = 2; | ||
1243 | break; | 1244 | break; |
1244 | case 0xe4: | 1245 | case 0xe4: |
1245 | name = "pc87364"; | 1246 | name = "pc87364"; |
@@ -1260,7 +1261,6 @@ static int pc87360_probe(struct platform_device *pdev) | |||
1260 | } | 1261 | } |
1261 | 1262 | ||
1262 | data->name = name; | 1263 | data->name = name; |
1263 | data->valid = 0; | ||
1264 | mutex_init(&data->lock); | 1264 | mutex_init(&data->lock); |
1265 | mutex_init(&data->update_lock); | 1265 | mutex_init(&data->update_lock); |
1266 | platform_set_drvdata(pdev, data); | 1266 | platform_set_drvdata(pdev, data); |