提交 a8ce4471 编写于 作者: L Lin Ming 提交者: Len Brown

ACPI: io_acpi_init.c: call acpi_get_name to get node fullname

acpi_ns_print_node_pathname is internal used only
use acpi_get_name instead to get node fullname
Signed-off-by: NLin Ming <ming.m.lin@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 46422814
...@@ -64,6 +64,7 @@ static acpi_status __init ...@@ -64,6 +64,7 @@ static acpi_status __init
sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
{ {
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
u64 addr; u64 addr;
struct hubdev_info *hubdev; struct hubdev_info *hubdev;
struct hubdev_info *hubdev_ptr; struct hubdev_info *hubdev_ptr;
...@@ -77,11 +78,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) ...@@ -77,11 +78,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
&sn_uuid, &buffer); &sn_uuid, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR printk(KERN_ERR
"sn_acpi_hubdev_init: acpi_get_vendor_resource() " "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
"(0x%x) failed for: ", status); "(0x%x) failed for: %s\n", status,
acpi_ns_print_node_pathname(handle, NULL); (char *)name_buffer.pointer);
printk("\n"); kfree(name_buffer.pointer);
return AE_OK; /* Continue walking namespace */ return AE_OK; /* Continue walking namespace */
} }
...@@ -89,11 +91,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) ...@@ -89,11 +91,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
vendor = &resource->data.vendor_typed; vendor = &resource->data.vendor_typed;
if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
sizeof(struct hubdev_info *)) { sizeof(struct hubdev_info *)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR printk(KERN_ERR
"sn_acpi_hubdev_init: Invalid vendor data length: %d for: ", "sn_acpi_hubdev_init: Invalid vendor data length: "
vendor->byte_length); "%d for: %s\n",
acpi_ns_print_node_pathname(handle, NULL); vendor->byte_length, (char *)name_buffer.pointer);
printk("\n"); kfree(name_buffer.pointer);
goto exit; goto exit;
} }
...@@ -120,6 +123,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus) ...@@ -120,6 +123,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
{ {
u64 addr; u64 addr;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_handle handle; acpi_handle handle;
struct pcibus_bussoft *prom_bussoft_ptr; struct pcibus_bussoft *prom_bussoft_ptr;
struct acpi_resource *resource; struct acpi_resource *resource;
...@@ -131,11 +135,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus) ...@@ -131,11 +135,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
&sn_uuid, &buffer); &sn_uuid, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR "%s: " printk(KERN_ERR "%s: "
"acpi_get_vendor_resource() failed (0x%x) for: ", "acpi_get_vendor_resource() failed (0x%x) for: %s\n",
__func__, status); __func__, status, (char *)name_buffer.pointer);
acpi_ns_print_node_pathname(handle, NULL); kfree(name_buffer.pointer);
printk("\n");
return NULL; return NULL;
} }
resource = buffer.pointer; resource = buffer.pointer;
...@@ -168,6 +172,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, ...@@ -168,6 +172,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
{ {
u64 addr; u64 addr;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct sn_irq_info *irq_info, *irq_info_prom; struct sn_irq_info *irq_info, *irq_info_prom;
struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr; struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;
struct acpi_resource *resource; struct acpi_resource *resource;
...@@ -182,11 +187,11 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, ...@@ -182,11 +187,11 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
&sn_uuid, &buffer); &sn_uuid, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR printk(KERN_ERR
"%s: acpi_get_vendor_resource() failed (0x%x) for: ", "%s: acpi_get_vendor_resource() failed (0x%x) for: %s\n",
__func__, status); __func__, status, (char *)name_buffer.pointer);
acpi_ns_print_node_pathname(handle, NULL); kfree(name_buffer.pointer);
printk("\n");
return 1; return 1;
} }
...@@ -194,11 +199,12 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, ...@@ -194,11 +199,12 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
vendor = &resource->data.vendor_typed; vendor = &resource->data.vendor_typed;
if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
sizeof(struct pci_devdev_info *)) { sizeof(struct pci_devdev_info *)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR printk(KERN_ERR
"%s: Invalid vendor data length: %d for: ", "%s: Invalid vendor data length: %d for: %s\n",
__func__, vendor->byte_length); __func__, vendor->byte_length,
acpi_ns_print_node_pathname(handle, NULL); (char *)name_buffer.pointer);
printk("\n"); kfree(name_buffer.pointer);
ret = 1; ret = 1;
goto exit; goto exit;
} }
...@@ -239,6 +245,9 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) ...@@ -239,6 +245,9 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
acpi_handle parent; acpi_handle parent;
int slot; int slot;
acpi_status status; acpi_status status;
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
acpi_get_name(device_handle, ACPI_FULL_PATHNAME, &name_buffer);
/* /*
* Do an upward search to find the root bus device, and * Do an upward search to find the root bus device, and
...@@ -249,9 +258,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) ...@@ -249,9 +258,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
status = acpi_get_parent(child, &parent); status = acpi_get_parent(child, &parent);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_ERR "%s: acpi_get_parent() failed " printk(KERN_ERR "%s: acpi_get_parent() failed "
"(0x%x) for: ", __func__, status); "(0x%x) for: %s\n", __func__, status,
acpi_ns_print_node_pathname(child, NULL); (char *)name_buffer.pointer);
printk("\n");
panic("%s: Unable to find host devfn\n", __func__); panic("%s: Unable to find host devfn\n", __func__);
} }
if (parent == rootbus_handle) if (parent == rootbus_handle)
...@@ -259,22 +267,20 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) ...@@ -259,22 +267,20 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
child = parent; child = parent;
} }
if (!child) { if (!child) {
printk(KERN_ERR "%s: Unable to find root bus for: ", printk(KERN_ERR "%s: Unable to find root bus for: %s\n",
__func__); __func__, (char *)name_buffer.pointer);
acpi_ns_print_node_pathname(device_handle, NULL);
printk("\n");
BUG(); BUG();
} }
status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr); status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ", printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: %s\n",
__func__, status); __func__, status, (char *)name_buffer.pointer);
acpi_ns_print_node_pathname(child, NULL);
printk("\n");
panic("%s: Unable to find host devfn\n", __func__); panic("%s: Unable to find host devfn\n", __func__);
} }
kfree(name_buffer.pointer);
slot = (adr >> 16) & 0xffff; slot = (adr >> 16) & 0xffff;
function = adr & 0xffff; function = adr & 0xffff;
devfn = PCI_DEVFN(slot, function); devfn = PCI_DEVFN(slot, function);
...@@ -300,27 +306,28 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv) ...@@ -300,27 +306,28 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
int function; int function;
int slot; int slot;
struct sn_pcidev_match *info = context; struct sn_pcidev_match *info = context;
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
&adr); &adr);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
status = acpi_get_parent(handle, &parent); status = acpi_get_parent(handle, &parent);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR printk(KERN_ERR
"%s: acpi_get_parent() failed (0x%x) for: ", "%s: acpi_get_parent() failed (0x%x) for: %s\n",
__func__, status); __func__, status, (char *)name_buffer.pointer);
acpi_ns_print_node_pathname(handle, NULL); kfree(name_buffer.pointer);
printk("\n");
return AE_OK; return AE_OK;
} }
status = acpi_evaluate_integer(parent, METHOD_NAME__BBN, status = acpi_evaluate_integer(parent, METHOD_NAME__BBN,
NULL, &bbn); NULL, &bbn);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
printk(KERN_ERR printk(KERN_ERR
"%s: Failed to find _BBN in parent of: ", "%s: Failed to find _BBN in parent of: %s\n",
__func__); __func__, (char *)name_buffer.pointer);
acpi_ns_print_node_pathname(handle, NULL); kfree(name_buffer.pointer);
printk("\n");
return AE_OK; return AE_OK;
} }
...@@ -350,24 +357,27 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info, ...@@ -350,24 +357,27 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
acpi_handle rootbus_handle; acpi_handle rootbus_handle;
unsigned long long segment; unsigned long long segment;
acpi_status status; acpi_status status;
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle; rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL, status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
&segment); &segment);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
if (segment != pci_domain_nr(dev)) { if (segment != pci_domain_nr(dev)) {
acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME,
&name_buffer);
printk(KERN_ERR printk(KERN_ERR
"%s: Segment number mismatch, 0x%llx vs 0x%x for: ", "%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
__func__, segment, pci_domain_nr(dev)); __func__, segment, pci_domain_nr(dev),
acpi_ns_print_node_pathname(rootbus_handle, NULL); (char *)name_buffer.pointer);
printk("\n"); kfree(name_buffer.pointer);
return 1; return 1;
} }
} else { } else {
printk(KERN_ERR "%s: Unable to get __SEG from: ", acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME, &name_buffer);
__func__); printk(KERN_ERR "%s: Unable to get __SEG from: %s\n",
acpi_ns_print_node_pathname(rootbus_handle, NULL); __func__, (char *)name_buffer.pointer);
printk("\n"); kfree(name_buffer.pointer);
return 1; return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册