diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-07 01:11:33 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-07 01:11:33 +0200 |
commit | d2fe7251a36012bc552a4c95246d486a8e284043 (patch) | |
tree | ca4a9e7b9ba148797e8bc899ac114343e3b488f9 /drivers/acpi/acpi_platform.c | |
parent | caf5c03f17c33a14ef0e7033000f89e4d0910f5a (diff) |
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_platform.c')
-rw-r--r-- | drivers/acpi/acpi_platform.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 32136b85196d..1bde12708f9e 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -61,25 +61,23 @@ 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; + } 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); + return -ENOMEM; + } + count = 0; + list_for_each_entry(rentry, &resource_list, node) + resources[count++] = rentry->res; - if (!count) - goto create_dev; - - 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); - return -ENOMEM; } - count = 0; - list_for_each_entry(rentry, &resource_list, node) - 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 |