From 65c19bbd28cba587d9bd24feccf7272da18481a7 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 27 Apr 2006 05:25:00 -0400 Subject: sem2mutex: drivers/acpi/processor_perflib.c Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/processor_perflib.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index abbdb37a7f5..7c6f97e9c72 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -34,6 +34,7 @@ #ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF #include #include +#include #include #endif @@ -48,7 +49,7 @@ #define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("acpi_processor") -static DECLARE_MUTEX(performance_sem); +static DEFINE_MUTEX(performance_mutex); /* * _PPC support is implemented as a CPUfreq policy notifier: @@ -72,7 +73,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, struct acpi_processor *pr; unsigned int ppc = 0; - down(&performance_sem); + mutex_lock(&performance_mutex); if (event != CPUFREQ_INCOMPATIBLE) goto out; @@ -93,7 +94,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, core_frequency * 1000); out: - up(&performance_sem); + mutex_unlock(&performance_mutex); return 0; } @@ -564,16 +565,16 @@ acpi_processor_register_performance(struct acpi_processor_performance if (!(acpi_processor_ppc_status & PPC_REGISTERED)) return_VALUE(-EINVAL); - down(&performance_sem); + mutex_lock(&performance_mutex); pr = processors[cpu]; if (!pr) { - up(&performance_sem); + mutex_unlock(&performance_mutex); return_VALUE(-ENODEV); } if (pr->performance) { - up(&performance_sem); + mutex_unlock(&performance_mutex); return_VALUE(-EBUSY); } @@ -581,13 +582,13 @@ acpi_processor_register_performance(struct acpi_processor_performance if (acpi_processor_get_performance_info(pr)) { pr->performance = NULL; - up(&performance_sem); + mutex_unlock(&performance_mutex); return_VALUE(-EIO); } acpi_cpufreq_add_file(pr); - up(&performance_sem); + mutex_unlock(&performance_mutex); return_VALUE(0); } @@ -601,11 +602,11 @@ acpi_processor_unregister_performance(struct acpi_processor_performance ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance"); - down(&performance_sem); + mutex_lock(&performance_mutex); pr = processors[cpu]; if (!pr) { - up(&performance_sem); + mutex_unlock(&performance_mutex); return_VOID; } @@ -614,7 +615,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance acpi_cpufreq_remove_file(pr); - up(&performance_sem); + mutex_unlock(&performance_mutex); return_VOID; } -- cgit v1.2.3-70-g09d2 From 415d320a2384bb80d2be98b1dfa41594e085012d Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sat, 13 May 2006 21:35:56 -0400 Subject: ACPI: delete unused acpi_bus_drivers_lock acpi_bus_drivers is protected by acpi_device_lock Signed-off-by: Len Brown --- drivers/acpi/scan.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index a0ab828b2cc..2cb3b0916eb 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -471,7 +471,6 @@ static int acpi_bus_get_perf_flags(struct acpi_device *device) -------------------------------------------------------------------------- */ static LIST_HEAD(acpi_bus_drivers); -static DECLARE_MUTEX(acpi_bus_drivers_lock); /** * acpi_bus_match - match device IDs to driver's supported IDs -- cgit v1.2.3-70-g09d2 From 36e430951af0b0d1bdfd50ce22e70079d02646df Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 27 Apr 2006 05:25:00 -0400 Subject: 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: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/pci_link.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 07bc6dfe662..b55ad1add1b 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -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 @@ -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; @@ -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); } @@ -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); } @@ -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; @@ -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); @@ -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); -- cgit v1.2.3-70-g09d2