Commit 36e43095 authored by Ingo Molnar's avatar Ingo Molnar Committed by Len Brown

sem2mutex: acpi, acpi_link_lock

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 415d320a
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mutex.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
...@@ -91,7 +92,7 @@ static struct { ...@@ -91,7 +92,7 @@ static struct {
int count; int count;
struct list_head entries; struct list_head entries;
} acpi_link; } acpi_link;
DECLARE_MUTEX(acpi_link_lock); DEFINE_MUTEX(acpi_link_lock);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
PCI Link Device Management PCI Link Device Management
...@@ -641,19 +642,19 @@ acpi_pci_link_allocate_irq(acpi_handle handle, ...@@ -641,19 +642,19 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
return_VALUE(-1); return_VALUE(-1);
} }
down(&acpi_link_lock); mutex_lock(&acpi_link_lock);
if (acpi_pci_link_allocate(link)) { if (acpi_pci_link_allocate(link)) {
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
return_VALUE(-1); return_VALUE(-1);
} }
if (!link->irq.active) { if (!link->irq.active) {
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n"));
return_VALUE(-1); return_VALUE(-1);
} }
link->refcnt++; link->refcnt++;
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
if (triggering) if (triggering)
*triggering = link->irq.triggering; *triggering = link->irq.triggering;
...@@ -691,9 +692,9 @@ int acpi_pci_link_free_irq(acpi_handle handle) ...@@ -691,9 +692,9 @@ int acpi_pci_link_free_irq(acpi_handle handle)
return_VALUE(-1); return_VALUE(-1);
} }
down(&acpi_link_lock); mutex_lock(&acpi_link_lock);
if (!link->irq.initialized) { if (!link->irq.initialized) {
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n")); ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n"));
return_VALUE(-1); return_VALUE(-1);
} }
...@@ -716,7 +717,7 @@ int acpi_pci_link_free_irq(acpi_handle handle) ...@@ -716,7 +717,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
if (link->refcnt == 0) { if (link->refcnt == 0) {
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
} }
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
return_VALUE(link->irq.active); return_VALUE(link->irq.active);
} }
...@@ -747,7 +748,7 @@ static int acpi_pci_link_add(struct acpi_device *device) ...@@ -747,7 +748,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
acpi_driver_data(device) = link; acpi_driver_data(device) = link;
down(&acpi_link_lock); mutex_lock(&acpi_link_lock);
result = acpi_pci_link_get_possible(link); result = acpi_pci_link_get_possible(link);
if (result) if (result)
goto end; goto end;
...@@ -782,7 +783,7 @@ static int acpi_pci_link_add(struct acpi_device *device) ...@@ -782,7 +783,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
end: end:
/* disable all links -- to be activated on use */ /* disable all links -- to be activated on use */
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
if (result) if (result)
kfree(link); kfree(link);
...@@ -837,9 +838,9 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type) ...@@ -837,9 +838,9 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type)
link = (struct acpi_pci_link *)acpi_driver_data(device); link = (struct acpi_pci_link *)acpi_driver_data(device);
down(&acpi_link_lock); mutex_lock(&acpi_link_lock);
list_del(&link->node); list_del(&link->node);
up(&acpi_link_lock); mutex_unlock(&acpi_link_lock);
kfree(link); kfree(link);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment