Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfe2414a authored by Jiang Liu's avatar Jiang Liu Committed by Bjorn Helgaas
Browse files

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



[bhelgaas: split out from acpi_handle_printk() changes]
Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 516ca223
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -382,13 +382,14 @@ static int acpi_pci_root_add(struct acpi_device *device,
	int result;
	struct acpi_pci_root *root;
	u32 flags, base_flags;
	acpi_handle handle = device->handle;

	root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
	if (!root)
		return -ENOMEM;

	segment = 0;
	status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL,
	status = acpi_evaluate_integer(handle, METHOD_NAME__SEG, NULL,
				       &segment);
	if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
		printk(KERN_ERR PREFIX "can't evaluate _SEG\n");
@@ -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. */
	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)) {
		/*
		 * 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,
		root->secondary.end = 0xFF;
		printk(KERN_WARNING FW_BUG PREFIX
		       "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);
		if (ACPI_SUCCESS(status))
			root->secondary.start = bus;
@@ -433,7 +434,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
	       acpi_device_name(device), acpi_device_bid(device),
	       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
@@ -502,7 +503,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
		dev_info(&device->dev,
			"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);
		if (ACPI_SUCCESS(status)) {
			dev_info(&device->dev,