summaryrefslogtreecommitdiff
path: root/drivers/acpi/glue.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-07 03:15:25 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-08 01:41:46 +0400
commit3fe444ad7e3a6951fa0c9b552c5afe6f6df0d571 (patch)
treee81f4cc4752f9c5c243e8f84a8470f5b48b8e19e /drivers/acpi/glue.c
parent69fdadfd2200e0bf3d10a7a7925db8e9fc5a46fd (diff)
downloadlinux-3fe444ad7e3a6951fa0c9b552c5afe6f6df0d571.tar.xz
ACPI: Do not fail acpi_bind_one() if device is already bound correctly
Modify acpi_bind_one() so that it doesn't fail if the device represented by its first argument has already been bound to the given ACPI handle (second argument), because that is not a good enough reason for returning an error code. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Lan Tianyu <tianyu.lan@intel.com> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi/glue.c')
-rw-r--r--drivers/acpi/glue.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 408f6b2a5fa8..48cc4c98e18b 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -217,7 +217,10 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
/* Sanity check. */
if (pn->dev == dev) {
dev_warn(dev, "Already associated with ACPI node\n");
- goto err_free;
+ if (ACPI_HANDLE(dev) == handle)
+ retval = 0;
+
+ goto out_free;
}
if (pn->node_id == node_id) {
physnode_list = &pn->node;
@@ -255,10 +258,14 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
put_device(dev);
return retval;
- err_free:
+ out_free:
mutex_unlock(&acpi_dev->physical_node_lock);
kfree(physical_node);
- goto err;
+ if (retval)
+ goto err;
+
+ put_device(dev);
+ return 0;
}
EXPORT_SYMBOL_GPL(acpi_bind_one);