summaryrefslogtreecommitdiff
path: root/drivers/acpi/glue.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-08 18:19:10 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-09 02:52:21 +0400
commit3342c753bdeb29ec29d721c7ce38d283cc969174 (patch)
tree8bd3bef8515efda660c3dee3b9ba887f3aba21a8 /drivers/acpi/glue.c
parent38e88839eff8a3d2e8d3bcc2ad833fe51cca0496 (diff)
downloadlinux-3342c753bdeb29ec29d721c7ce38d283cc969174.tar.xz
ACPI: Drop unnecessary label from acpi_bind_one()
The out_free label in acpi_bind_one() is only jumped to from one place, so in fact it is not necessary, because the code below it can be moved to that place directly. Move that code and drop the label. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi/glue.c')
-rw-r--r--drivers/acpi/glue.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index dcba319ac3f1..f3ead0ce37ab 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -225,11 +225,15 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
list_for_each_entry(pn, &acpi_dev->physical_node_list, node) {
/* Sanity check. */
if (pn->dev == dev) {
+ mutex_unlock(&acpi_dev->physical_node_lock);
+
dev_warn(dev, "Already associated with ACPI node\n");
- if (ACPI_HANDLE(dev) == handle)
- retval = 0;
+ kfree(physical_node);
+ if (ACPI_HANDLE(dev) != handle)
+ goto err;
- goto out_free;
+ put_device(dev);
+ return 0;
}
if (pn->node_id == node_id) {
physnode_list = &pn->node;
@@ -262,15 +266,6 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
ACPI_HANDLE_SET(dev, NULL);
put_device(dev);
return retval;
-
- out_free:
- mutex_unlock(&acpi_dev->physical_node_lock);
- kfree(physical_node);
- if (retval)
- goto err;
-
- put_device(dev);
- return 0;
}
EXPORT_SYMBOL_GPL(acpi_bind_one);