diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/ibmpex.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index e14ce3d79d12..9c9cdb0685e4 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c | |||
@@ -140,10 +140,10 @@ static int ibmpex_send_message(struct ibmpex_bmc_data *data) | |||
140 | 140 | ||
141 | return 0; | 141 | return 0; |
142 | out1: | 142 | out1: |
143 | printk(KERN_ERR "%s: request_settime=%x\n", __FUNCTION__, err); | 143 | dev_err(data->bmc_device, "request_settime=%x\n", err); |
144 | return err; | 144 | return err; |
145 | out: | 145 | out: |
146 | printk(KERN_ERR "%s: validate_addr=%x\n", __FUNCTION__, err); | 146 | dev_err(data->bmc_device, "validate_addr=%x\n", err); |
147 | return err; | 147 | return err; |
148 | } | 148 | } |
149 | 149 | ||
@@ -161,14 +161,14 @@ static int ibmpex_ver_check(struct ibmpex_bmc_data *data) | |||
161 | data->sensor_major = data->rx_msg_data[0]; | 161 | data->sensor_major = data->rx_msg_data[0]; |
162 | data->sensor_minor = data->rx_msg_data[1]; | 162 | data->sensor_minor = data->rx_msg_data[1]; |
163 | 163 | ||
164 | printk(KERN_INFO DRVNAME ": Found BMC with sensor interface " | 164 | dev_info(data->bmc_device, "Found BMC with sensor interface " |
165 | "v%d.%d %d-%02d-%02d on interface %d\n", | 165 | "v%d.%d %d-%02d-%02d on interface %d\n", |
166 | data->sensor_major, | 166 | data->sensor_major, |
167 | data->sensor_minor, | 167 | data->sensor_minor, |
168 | extract_value(data->rx_msg_data, 2), | 168 | extract_value(data->rx_msg_data, 2), |
169 | data->rx_msg_data[4], | 169 | data->rx_msg_data[4], |
170 | data->rx_msg_data[5], | 170 | data->rx_msg_data[5], |
171 | data->interface); | 171 | data->interface); |
172 | 172 | ||
173 | return 0; | 173 | return 0; |
174 | } | 174 | } |
@@ -212,8 +212,8 @@ static int ibmpex_query_sensor_data(struct ibmpex_bmc_data *data, int sensor) | |||
212 | wait_for_completion(&data->read_complete); | 212 | wait_for_completion(&data->read_complete); |
213 | 213 | ||
214 | if (data->rx_result || data->rx_msg_len < 26) { | 214 | if (data->rx_result || data->rx_msg_len < 26) { |
215 | printk(KERN_ERR "Error reading sensor %d, please check.\n", | 215 | dev_err(data->bmc_device, "Error reading sensor %d.\n", |
216 | sensor); | 216 | sensor); |
217 | return -ENOENT; | 217 | return -ENOENT; |
218 | } | 218 | } |
219 | 219 | ||
@@ -456,8 +456,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev) | |||
456 | 456 | ||
457 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 457 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
458 | if (!data) { | 458 | if (!data) { |
459 | printk(KERN_ERR DRVNAME ": Insufficient memory for BMC " | 459 | dev_err(dev, "Insufficient memory for BMC interface.\n"); |
460 | "interface.\n"); | ||
461 | return; | 460 | return; |
462 | } | 461 | } |
463 | 462 | ||
@@ -471,9 +470,8 @@ static void ibmpex_register_bmc(int iface, struct device *dev) | |||
471 | err = ipmi_create_user(data->interface, &driver_data.ipmi_hndlrs, | 470 | err = ipmi_create_user(data->interface, &driver_data.ipmi_hndlrs, |
472 | data, &data->user); | 471 | data, &data->user); |
473 | if (err < 0) { | 472 | if (err < 0) { |
474 | printk(KERN_ERR DRVNAME ": Error, unable to register user with " | 473 | dev_err(dev, "Unable to register user with IPMI " |
475 | "ipmi interface %d\n", | 474 | "interface %d\n", data->interface); |
476 | data->interface); | ||
477 | goto out; | 475 | goto out; |
478 | } | 476 | } |
479 | 477 | ||
@@ -495,9 +493,9 @@ static void ibmpex_register_bmc(int iface, struct device *dev) | |||
495 | data->hwmon_dev = hwmon_device_register(data->bmc_device); | 493 | data->hwmon_dev = hwmon_device_register(data->bmc_device); |
496 | 494 | ||
497 | if (IS_ERR(data->hwmon_dev)) { | 495 | if (IS_ERR(data->hwmon_dev)) { |
498 | printk(KERN_ERR DRVNAME ": Error, unable to register hwmon " | 496 | dev_err(data->bmc_device, "Unable to register hwmon " |
499 | "class device for interface %d\n", | 497 | "device for IPMI interface %d\n", |
500 | data->interface); | 498 | data->interface); |
501 | goto out_user; | 499 | goto out_user; |
502 | } | 500 | } |
503 | 501 | ||
@@ -508,7 +506,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev) | |||
508 | /* Now go find all the sensors */ | 506 | /* Now go find all the sensors */ |
509 | err = ibmpex_find_sensors(data); | 507 | err = ibmpex_find_sensors(data); |
510 | if (err) { | 508 | if (err) { |
511 | printk(KERN_ERR "Error %d allocating memory\n", err); | 509 | dev_err(data->bmc_device, "Error %d finding sensors\n", err); |
512 | goto out_register; | 510 | goto out_register; |
513 | } | 511 | } |
514 | 512 | ||
@@ -561,10 +559,10 @@ static void ibmpex_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) | |||
561 | struct ibmpex_bmc_data *data = (struct ibmpex_bmc_data *)user_msg_data; | 559 | struct ibmpex_bmc_data *data = (struct ibmpex_bmc_data *)user_msg_data; |
562 | 560 | ||
563 | if (msg->msgid != data->tx_msgid) { | 561 | if (msg->msgid != data->tx_msgid) { |
564 | printk(KERN_ERR "Received msgid (%02x) and transmitted " | 562 | dev_err(data->bmc_device, "Mismatch between received msgid " |
565 | "msgid (%02x) mismatch!\n", | 563 | "(%02x) and transmitted msgid (%02x)!\n", |
566 | (int)msg->msgid, | 564 | (int)msg->msgid, |
567 | (int)data->tx_msgid); | 565 | (int)data->tx_msgid); |
568 | ipmi_free_recv_msg(msg); | 566 | ipmi_free_recv_msg(msg); |
569 | return; | 567 | return; |
570 | } | 568 | } |