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>
This commit is contained in:
parent
47db4547ff
commit
ab6c57099d
1 changed files with 13 additions and 11 deletions
|
@ -31,6 +31,7 @@
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/memory_hotplug.h>
|
#include <linux/memory_hotplug.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/acpi.h>
|
||||||
#include <acpi/acpi_drivers.h>
|
#include <acpi/acpi_drivers.h>
|
||||||
|
|
||||||
#define ACPI_MEMORY_DEVICE_CLASS "memory"
|
#define ACPI_MEMORY_DEVICE_CLASS "memory"
|
||||||
|
@ -175,7 +176,7 @@ acpi_memory_get_device(acpi_handle handle,
|
||||||
/* Get the parent device */
|
/* Get the parent device */
|
||||||
result = acpi_bus_get_device(phandle, &pdevice);
|
result = acpi_bus_get_device(phandle, &pdevice);
|
||||||
if (result) {
|
if (result) {
|
||||||
printk(KERN_WARNING PREFIX "Cannot get acpi bus device");
|
acpi_handle_warn(phandle, "Cannot get acpi bus device\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,14 +186,14 @@ acpi_memory_get_device(acpi_handle handle,
|
||||||
*/
|
*/
|
||||||
result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
|
result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
|
||||||
if (result) {
|
if (result) {
|
||||||
printk(KERN_WARNING PREFIX "Cannot add acpi bus");
|
acpi_handle_warn(handle, "Cannot add acpi bus\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
*mem_device = acpi_driver_data(device);
|
*mem_device = acpi_driver_data(device);
|
||||||
if (!(*mem_device)) {
|
if (!(*mem_device)) {
|
||||||
printk(KERN_ERR "\n driver data not found");
|
dev_err(&device->dev, "driver data not found\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +230,8 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
|
||||||
/* Get the range from the _CRS */
|
/* Get the range from the _CRS */
|
||||||
result = acpi_memory_get_device_resources(mem_device);
|
result = acpi_memory_get_device_resources(mem_device);
|
||||||
if (result) {
|
if (result) {
|
||||||
printk(KERN_ERR PREFIX "get_device_resources failed\n");
|
dev_err(&mem_device->device->dev,
|
||||||
|
"get_device_resources failed\n");
|
||||||
mem_device->state = MEMORY_INVALID_STATE;
|
mem_device->state = MEMORY_INVALID_STATE;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -276,7 +278,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
|
||||||
num_enabled++;
|
num_enabled++;
|
||||||
}
|
}
|
||||||
if (!num_enabled) {
|
if (!num_enabled) {
|
||||||
printk(KERN_ERR PREFIX "add_memory failed\n");
|
dev_err(&mem_device->device->dev, "add_memory failed\n");
|
||||||
mem_device->state = MEMORY_INVALID_STATE;
|
mem_device->state = MEMORY_INVALID_STATE;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -336,7 +338,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||||
"\nReceived DEVICE CHECK notification for device\n"));
|
"\nReceived DEVICE CHECK notification for device\n"));
|
||||||
if (acpi_memory_get_device(handle, &mem_device)) {
|
if (acpi_memory_get_device(handle, &mem_device)) {
|
||||||
printk(KERN_ERR PREFIX "Cannot find driver data\n");
|
acpi_handle_err(handle, "Cannot find driver data\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +346,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (acpi_memory_enable_device(mem_device)) {
|
if (acpi_memory_enable_device(mem_device)) {
|
||||||
printk(KERN_ERR PREFIX "Cannot enable memory device\n");
|
acpi_handle_err(handle,"Cannot enable memory device\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,12 +358,12 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
|
||||||
"\nReceived EJECT REQUEST notification for device\n"));
|
"\nReceived EJECT REQUEST notification for device\n"));
|
||||||
|
|
||||||
if (acpi_bus_get_device(handle, &device)) {
|
if (acpi_bus_get_device(handle, &device)) {
|
||||||
printk(KERN_ERR PREFIX "Device doesn't exist\n");
|
acpi_handle_err(handle, "Device doesn't exist\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mem_device = acpi_driver_data(device);
|
mem_device = acpi_driver_data(device);
|
||||||
if (!mem_device) {
|
if (!mem_device) {
|
||||||
printk(KERN_ERR PREFIX "Driver Data is NULL\n");
|
acpi_handle_err(handle, "Driver Data is NULL\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,13 +431,13 @@ static int acpi_memory_device_add(struct acpi_device *device)
|
||||||
/* Set the device state */
|
/* Set the device state */
|
||||||
mem_device->state = MEMORY_POWER_ON_STATE;
|
mem_device->state = MEMORY_POWER_ON_STATE;
|
||||||
|
|
||||||
printk(KERN_DEBUG "%s \n", acpi_device_name(device));
|
pr_debug("%s\n", acpi_device_name(device));
|
||||||
|
|
||||||
if (!acpi_memory_check_device(mem_device)) {
|
if (!acpi_memory_check_device(mem_device)) {
|
||||||
/* call add_memory func */
|
/* call add_memory func */
|
||||||
result = acpi_memory_enable_device(mem_device);
|
result = acpi_memory_enable_device(mem_device);
|
||||||
if (result) {
|
if (result) {
|
||||||
printk(KERN_ERR PREFIX
|
dev_err(&device->dev,
|
||||||
"Error in acpi_memory_enable_device\n");
|
"Error in acpi_memory_enable_device\n");
|
||||||
acpi_memory_device_free(mem_device);
|
acpi_memory_device_free(mem_device);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue