diff options
author | Toshi Kani <toshi.kani@hp.com> | 2012-11-20 18:42:28 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-21 17:20:22 -0500 |
commit | ab6c57099db14d64c383e4d0392eab05d013630f (patch) | |
tree | 9b2cf7bb1abb765d2a99b177e5e4a66a0a45acce /drivers/acpi | |
parent | 47db4547ffe5aa2eb5b053e6c02f0561fbbfa221 (diff) |
ACPI: Update Memory hotplug error messages
Updated Memory hotplug error messages with acpi_handle_<level>(),
dev_<level>() and pr_<level>(). Added missing "\n".
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index e0f7425c8854..eb30e5ab4cab 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <linux/memory_hotplug.h> | 32 | #include <linux/memory_hotplug.h> |
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/acpi.h> | ||
34 | #include <acpi/acpi_drivers.h> | 35 | #include <acpi/acpi_drivers.h> |
35 | 36 | ||
36 | #define ACPI_MEMORY_DEVICE_CLASS "memory" | 37 | #define ACPI_MEMORY_DEVICE_CLASS "memory" |
@@ -175,7 +176,7 @@ acpi_memory_get_device(acpi_handle handle, | |||
175 | /* Get the parent device */ | 176 | /* Get the parent device */ |
176 | result = acpi_bus_get_device(phandle, &pdevice); | 177 | result = acpi_bus_get_device(phandle, &pdevice); |
177 | if (result) { | 178 | if (result) { |
178 | printk(KERN_WARNING PREFIX "Cannot get acpi bus device"); | 179 | acpi_handle_warn(phandle, "Cannot get acpi bus device\n"); |
179 | return -EINVAL; | 180 | return -EINVAL; |
180 | } | 181 | } |
181 | 182 | ||
@@ -185,14 +186,14 @@ acpi_memory_get_device(acpi_handle handle, | |||
185 | */ | 186 | */ |
186 | result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); | 187 | result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); |
187 | if (result) { | 188 | if (result) { |
188 | printk(KERN_WARNING PREFIX "Cannot add acpi bus"); | 189 | acpi_handle_warn(handle, "Cannot add acpi bus\n"); |
189 | return -EINVAL; | 190 | return -EINVAL; |
190 | } | 191 | } |
191 | 192 | ||
192 | end: | 193 | end: |
193 | *mem_device = acpi_driver_data(device); | 194 | *mem_device = acpi_driver_data(device); |
194 | if (!(*mem_device)) { | 195 | if (!(*mem_device)) { |
195 | printk(KERN_ERR "\n driver data not found"); | 196 | dev_err(&device->dev, "driver data not found\n"); |
196 | return -ENODEV; | 197 | return -ENODEV; |
197 | } | 198 | } |
198 | 199 | ||
@@ -229,7 +230,8 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
229 | /* Get the range from the _CRS */ | 230 | /* Get the range from the _CRS */ |
230 | result = acpi_memory_get_device_resources(mem_device); | 231 | result = acpi_memory_get_device_resources(mem_device); |
231 | if (result) { | 232 | if (result) { |
232 | printk(KERN_ERR PREFIX "get_device_resources failed\n"); | 233 | dev_err(&mem_device->device->dev, |
234 | "get_device_resources failed\n"); | ||
233 | mem_device->state = MEMORY_INVALID_STATE; | 235 | mem_device->state = MEMORY_INVALID_STATE; |
234 | return result; | 236 | return result; |
235 | } | 237 | } |
@@ -276,7 +278,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
276 | num_enabled++; | 278 | num_enabled++; |
277 | } | 279 | } |
278 | if (!num_enabled) { | 280 | if (!num_enabled) { |
279 | printk(KERN_ERR PREFIX "add_memory failed\n"); | 281 | dev_err(&mem_device->device->dev, "add_memory failed\n"); |
280 | mem_device->state = MEMORY_INVALID_STATE; | 282 | mem_device->state = MEMORY_INVALID_STATE; |
281 | return -EINVAL; | 283 | return -EINVAL; |
282 | } | 284 | } |
@@ -336,7 +338,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
336 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 338 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
337 | "\nReceived DEVICE CHECK notification for device\n")); | 339 | "\nReceived DEVICE CHECK notification for device\n")); |
338 | if (acpi_memory_get_device(handle, &mem_device)) { | 340 | if (acpi_memory_get_device(handle, &mem_device)) { |
339 | printk(KERN_ERR PREFIX "Cannot find driver data\n"); | 341 | acpi_handle_err(handle, "Cannot find driver data\n"); |
340 | break; | 342 | break; |
341 | } | 343 | } |
342 | 344 | ||
@@ -344,7 +346,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
344 | break; | 346 | break; |
345 | 347 | ||
346 | if (acpi_memory_enable_device(mem_device)) { | 348 | if (acpi_memory_enable_device(mem_device)) { |
347 | printk(KERN_ERR PREFIX "Cannot enable memory device\n"); | 349 | acpi_handle_err(handle,"Cannot enable memory device\n"); |
348 | break; | 350 | break; |
349 | } | 351 | } |
350 | 352 | ||
@@ -356,12 +358,12 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
356 | "\nReceived EJECT REQUEST notification for device\n")); | 358 | "\nReceived EJECT REQUEST notification for device\n")); |
357 | 359 | ||
358 | if (acpi_bus_get_device(handle, &device)) { | 360 | if (acpi_bus_get_device(handle, &device)) { |
359 | printk(KERN_ERR PREFIX "Device doesn't exist\n"); | 361 | acpi_handle_err(handle, "Device doesn't exist\n"); |
360 | break; | 362 | break; |
361 | } | 363 | } |
362 | mem_device = acpi_driver_data(device); | 364 | mem_device = acpi_driver_data(device); |
363 | if (!mem_device) { | 365 | if (!mem_device) { |
364 | printk(KERN_ERR PREFIX "Driver Data is NULL\n"); | 366 | acpi_handle_err(handle, "Driver Data is NULL\n"); |
365 | break; | 367 | break; |
366 | } | 368 | } |
367 | 369 | ||
@@ -429,13 +431,13 @@ static int acpi_memory_device_add(struct acpi_device *device) | |||
429 | /* Set the device state */ | 431 | /* Set the device state */ |
430 | mem_device->state = MEMORY_POWER_ON_STATE; | 432 | mem_device->state = MEMORY_POWER_ON_STATE; |
431 | 433 | ||
432 | printk(KERN_DEBUG "%s \n", acpi_device_name(device)); | 434 | pr_debug("%s\n", acpi_device_name(device)); |
433 | 435 | ||
434 | if (!acpi_memory_check_device(mem_device)) { | 436 | if (!acpi_memory_check_device(mem_device)) { |
435 | /* call add_memory func */ | 437 | /* call add_memory func */ |
436 | result = acpi_memory_enable_device(mem_device); | 438 | result = acpi_memory_enable_device(mem_device); |
437 | if (result) { | 439 | if (result) { |
438 | printk(KERN_ERR PREFIX | 440 | dev_err(&device->dev, |
439 | "Error in acpi_memory_enable_device\n"); | 441 | "Error in acpi_memory_enable_device\n"); |
440 | acpi_memory_device_free(mem_device); | 442 | acpi_memory_device_free(mem_device); |
441 | } | 443 | } |