aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-09-18 12:48:16 -0400
committerMark M. Hoffman <mhoffman@lightlink.com>2007-10-09 22:56:31 -0400
commitcc28a610d4fcce1831d26f2099e23fbb3eb7260c (patch)
tree0a0e57e5f3be7011a81feb8f5691e6c1e0c84905 /drivers/hwmon
parent894c00cf3805670faddd41d3d5dcb3c0ab75a39d (diff)
hwmon: (thmc50) Fix a debug message
type_name was used before being set. See why I don't like play-it-safe variable initializations: they prevent the compiler from warning you about such mistakes. So fix that as well. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/thmc50.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c
index fb02834897f3..04dd7699b3ac 100644
--- a/drivers/hwmon/thmc50.c
+++ b/drivers/hwmon/thmc50.c
@@ -259,7 +259,7 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
259 struct thmc50_data *data; 259 struct thmc50_data *data;
260 struct device *dev; 260 struct device *dev;
261 int err = 0; 261 int err = 0;
262 const char *type_name = ""; 262 const char *type_name;
263 263
264 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { 264 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
265 pr_debug("thmc50: detect failed, " 265 pr_debug("thmc50: detect failed, "
@@ -309,13 +309,9 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
309 pr_debug("thmc50: Detection of THMC50/ADM1022 failed\n"); 309 pr_debug("thmc50: Detection of THMC50/ADM1022 failed\n");
310 goto exit_free; 310 goto exit_free;
311 } 311 }
312 pr_debug("thmc50: Detected %s (version %x, revision %x)\n",
313 type_name, (revision >> 4) - 0xc, revision & 0xf);
314 data->type = kind; 312 data->type = kind;
315 313
316 if (kind == thmc50) 314 if (kind == adm1022) {
317 type_name = "thmc50";
318 else if (kind == adm1022) {
319 int id = i2c_adapter_id(client->adapter); 315 int id = i2c_adapter_id(client->adapter);
320 int i; 316 int i;
321 317
@@ -328,7 +324,11 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
328 data->has_temp3 = 1; 324 data->has_temp3 = 1;
329 break; 325 break;
330 } 326 }
327 } else {
328 type_name = "thmc50";
331 } 329 }
330 pr_debug("thmc50: Detected %s (version %x, revision %x)\n",
331 type_name, (revision >> 4) - 0xc, revision & 0xf);
332 332
333 /* Fill in the remaining client fields & put it into the global list */ 333 /* Fill in the remaining client fields & put it into the global list */
334 strlcpy(client->name, type_name, I2C_NAME_SIZE); 334 strlcpy(client->name, type_name, I2C_NAME_SIZE);