Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29151
b: refs/heads/master
c: 36e4309
h: refs/heads/master
i:
  29149: ff84a72
  29147: c20546a
  29143: 41a4261
  29135: 78a4ed3
  29119: 7f7aca2
v: v3
  • Loading branch information
Ingo Molnar authored and Len Brown committed May 14, 2006
1 parent ac1f1f4 commit c94be8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 415d320a2384bb80d2be98b1dfa41594e085012d
refs/heads/master: 36e430951af0b0d1bdfd50ce22e70079d02646df
25 changes: 13 additions & 12 deletions trunk/drivers/acpi/pci_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/spinlock.h>
#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/mutex.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
Expand Down Expand Up @@ -91,7 +92,7 @@ static struct {
int count;
struct list_head entries;
} acpi_link;
DECLARE_MUTEX(acpi_link_lock);
DEFINE_MUTEX(acpi_link_lock);

/* --------------------------------------------------------------------------
PCI Link Device Management
Expand Down Expand Up @@ -641,19 +642,19 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
return_VALUE(-1);
}

down(&acpi_link_lock);
mutex_lock(&acpi_link_lock);
if (acpi_pci_link_allocate(link)) {
up(&acpi_link_lock);
mutex_unlock(&acpi_link_lock);
return_VALUE(-1);
}

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"));
return_VALUE(-1);
}
link->refcnt++;
up(&acpi_link_lock);
mutex_unlock(&acpi_link_lock);

if (triggering)
*triggering = link->irq.triggering;
Expand Down Expand Up @@ -691,9 +692,9 @@ int acpi_pci_link_free_irq(acpi_handle handle)
return_VALUE(-1);
}

down(&acpi_link_lock);
mutex_lock(&acpi_link_lock);
if (!link->irq.initialized) {
up(&acpi_link_lock);
mutex_unlock(&acpi_link_lock);
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n"));
return_VALUE(-1);
}
Expand All @@ -716,7 +717,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
if (link->refcnt == 0) {
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
}
up(&acpi_link_lock);
mutex_unlock(&acpi_link_lock);
return_VALUE(link->irq.active);
}

Expand Down Expand Up @@ -747,7 +748,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
acpi_driver_data(device) = link;

down(&acpi_link_lock);
mutex_lock(&acpi_link_lock);
result = acpi_pci_link_get_possible(link);
if (result)
goto end;
Expand Down Expand Up @@ -782,7 +783,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
end:
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
up(&acpi_link_lock);
mutex_unlock(&acpi_link_lock);

if (result)
kfree(link);
Expand Down Expand Up @@ -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);

down(&acpi_link_lock);
mutex_lock(&acpi_link_lock);
list_del(&link->node);
up(&acpi_link_lock);
mutex_unlock(&acpi_link_lock);

kfree(link);

Expand Down

0 comments on commit c94be8a

Please sign in to comment.