aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83781d.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2006-10-13 11:03:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-18 16:03:09 -0400
commitbd452e6f178a559408c54c2b4ca29191b812d47f (patch)
treec6806233f5b112b6d0a094fbb435ce5cda017c2c /drivers/hwmon/w83781d.c
parente693810ce8495ce3e227dacaa83f501b3b8ab204 (diff)
hwmon: Fix debug messages in w83781d
Fix debug messages in w83781d at detection time. We can't use dev_dbg() on an i2c client's device before calling i2c_attach_client() on that client. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon/w83781d.c')
-rw-r--r--drivers/hwmon/w83781d.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index fea92061f863..1232171c3aad 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1099,7 +1099,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1099 bank. */ 1099 bank. */
1100 if (kind < 0) { 1100 if (kind < 0) {
1101 if (w83781d_read_value(client, W83781D_REG_CONFIG) & 0x80) { 1101 if (w83781d_read_value(client, W83781D_REG_CONFIG) & 0x80) {
1102 dev_dbg(dev, "Detection failed at step 3\n"); 1102 dev_dbg(&adapter->dev, "Detection of w83781d chip "
1103 "failed at step 3\n");
1103 err = -ENODEV; 1104 err = -ENODEV;
1104 goto ERROR2; 1105 goto ERROR2;
1105 } 1106 }
@@ -1109,7 +1110,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1109 if ((!(val1 & 0x07)) && 1110 if ((!(val1 & 0x07)) &&
1110 (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3)) 1111 (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
1111 || ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) { 1112 || ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
1112 dev_dbg(dev, "Detection failed at step 4\n"); 1113 dev_dbg(&adapter->dev, "Detection of w83781d chip "
1114 "failed at step 4\n");
1113 err = -ENODEV; 1115 err = -ENODEV;
1114 goto ERROR2; 1116 goto ERROR2;
1115 } 1117 }
@@ -1119,7 +1121,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1119 ((val1 & 0x80) && (val2 == 0x5c)))) { 1121 ((val1 & 0x80) && (val2 == 0x5c)))) {
1120 if (w83781d_read_value 1122 if (w83781d_read_value
1121 (client, W83781D_REG_I2C_ADDR) != address) { 1123 (client, W83781D_REG_I2C_ADDR) != address) {
1122 dev_dbg(dev, "Detection failed at step 5\n"); 1124 dev_dbg(&adapter->dev, "Detection of w83781d "
1125 "chip failed at step 5\n");
1123 err = -ENODEV; 1126 err = -ENODEV;
1124 goto ERROR2; 1127 goto ERROR2;
1125 } 1128 }
@@ -1141,8 +1144,8 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1141 else if (val2 == 0x12) 1144 else if (val2 == 0x12)
1142 vendid = asus; 1145 vendid = asus;
1143 else { 1146 else {
1144 dev_dbg(dev, "Chip was made by neither " 1147 dev_dbg(&adapter->dev, "w83781d chip vendor is "
1145 "Winbond nor Asus?\n"); 1148 "neither Winbond nor Asus\n");
1146 err = -ENODEV; 1149 err = -ENODEV;
1147 goto ERROR2; 1150 goto ERROR2;
1148 } 1151 }
@@ -1161,10 +1164,9 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1161 kind = as99127f; 1164 kind = as99127f;
1162 else { 1165 else {
1163 if (kind == 0) 1166 if (kind == 0)
1164 dev_warn(dev, "Ignoring 'force' " 1167 dev_warn(&adapter->dev, "Ignoring 'force' "
1165 "parameter for unknown chip at " 1168 "parameter for unknown chip at "
1166 "adapter %d, address 0x%02x\n", 1169 "address 0x%02x\n", address);
1167 i2c_adapter_id(adapter), address);
1168 err = -EINVAL; 1170 err = -EINVAL;
1169 goto ERROR2; 1171 goto ERROR2;
1170 } 1172 }