提交 bfe2414a 编写于 作者: J Jiang Liu 提交者: Bjorn Helgaas

PCI/ACPI: Introduce "handle" local for economy of expression

[bhelgaas: split out from acpi_handle_printk() changes]
Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 516ca223
...@@ -382,13 +382,14 @@ static int acpi_pci_root_add(struct acpi_device *device, ...@@ -382,13 +382,14 @@ static int acpi_pci_root_add(struct acpi_device *device,
int result; int result;
struct acpi_pci_root *root; struct acpi_pci_root *root;
u32 flags, base_flags; u32 flags, base_flags;
acpi_handle handle = device->handle;
root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
if (!root) if (!root)
return -ENOMEM; return -ENOMEM;
segment = 0; segment = 0;
status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL, status = acpi_evaluate_integer(handle, METHOD_NAME__SEG, NULL,
&segment); &segment);
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
printk(KERN_ERR PREFIX "can't evaluate _SEG\n"); printk(KERN_ERR PREFIX "can't evaluate _SEG\n");
...@@ -398,7 +399,7 @@ static int acpi_pci_root_add(struct acpi_device *device, ...@@ -398,7 +399,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
/* Check _CRS first, then _BBN. If no _BBN, default to zero. */ /* Check _CRS first, then _BBN. If no _BBN, default to zero. */
root->secondary.flags = IORESOURCE_BUS; root->secondary.flags = IORESOURCE_BUS;
status = try_get_root_bridge_busnr(device->handle, &root->secondary); status = try_get_root_bridge_busnr(handle, &root->secondary);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
/* /*
* We need both the start and end of the downstream bus range * We need both the start and end of the downstream bus range
...@@ -409,7 +410,7 @@ static int acpi_pci_root_add(struct acpi_device *device, ...@@ -409,7 +410,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
root->secondary.end = 0xFF; root->secondary.end = 0xFF;
printk(KERN_WARNING FW_BUG PREFIX printk(KERN_WARNING FW_BUG PREFIX
"no secondary bus range in _CRS\n"); "no secondary bus range in _CRS\n");
status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, status = acpi_evaluate_integer(handle, METHOD_NAME__BBN,
NULL, &bus); NULL, &bus);
if (ACPI_SUCCESS(status)) if (ACPI_SUCCESS(status))
root->secondary.start = bus; root->secondary.start = bus;
...@@ -433,7 +434,7 @@ static int acpi_pci_root_add(struct acpi_device *device, ...@@ -433,7 +434,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
acpi_device_name(device), acpi_device_bid(device), acpi_device_name(device), acpi_device_bid(device),
root->segment, &root->secondary); root->segment, &root->secondary);
root->mcfg_addr = acpi_pci_root_get_mcfg_addr(device->handle); root->mcfg_addr = acpi_pci_root_get_mcfg_addr(handle);
/* /*
* All supported architectures that use ACPI have support for * All supported architectures that use ACPI have support for
...@@ -502,7 +503,7 @@ static int acpi_pci_root_add(struct acpi_device *device, ...@@ -502,7 +503,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
dev_info(&device->dev, dev_info(&device->dev,
"Requesting ACPI _OSC control (0x%02x)\n", flags); "Requesting ACPI _OSC control (0x%02x)\n", flags);
status = acpi_pci_osc_control_set(device->handle, &flags, status = acpi_pci_osc_control_set(handle, &flags,
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
dev_info(&device->dev, dev_info(&device->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册