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

Commit d2fe7251 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ACPI / scan: Drop unnecessary label from acpi_create_platform_device()



The create_dev label in acpi_create_platform_device() is not
necessary, because the if statement causing the jump to it to
happen may be rearranged to avoid that jump.

Rework the code accordingly (no functional changes should result
drom that).

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent caf5c03f
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -61,13 +61,11 @@ int acpi_create_platform_device(struct acpi_device *adev,

	INIT_LIST_HEAD(&resource_list);
	count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
	if (count < 0)
	if (count < 0) {
		return 0;

	if (!count)
		goto create_dev;

	resources = kmalloc(count * sizeof(struct resource), GFP_KERNEL);
	} else if (count > 0) {
		resources = kmalloc(count * sizeof(struct resource),
				    GFP_KERNEL);
		if (!resources) {
			dev_err(&adev->dev, "No memory for resources\n");
			acpi_dev_free_resource_list(&resource_list);
@@ -78,8 +76,8 @@ int acpi_create_platform_device(struct acpi_device *adev,
			resources[count++] = rentry->res;

		acpi_dev_free_resource_list(&resource_list);
	}

create_dev:
	memset(&pdevinfo, 0, sizeof(pdevinfo));
	/*
	 * If the ACPI node has a parent and that parent has a physical device