aboutsummaryrefslogtreecommitdiff
path: root/drivers/pnp/interface.c
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-02-06 01:40:04 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 10:41:20 -0800
commitb3bd86e2fdce01d6b49271a553d2a18b3e0510f3 (patch)
treef7282cbe7454a90a4b9b105c3c2e6d9734964791 /drivers/pnp/interface.c
parent2bb9a6b32f98873adf89a0de04c898681a2c5b8e (diff)
isapnp driver semaphore to mutex
Changed the isapnp semaphore to a mutex. [akpm@linux-foundation.org: no externs-in-c] [akpm@linux-foundation.org: build fix] Signed-off-by: Daniel Walker <dwalker@mvista.com> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pnp/interface.c')
-rw-r--r--drivers/pnp/interface.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 31548044fdd..982658477a5 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -10,9 +10,12 @@
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/types.h>
+#include <linux/pnp.h>
#include <linux/stat.h>
#include <linux/ctype.h>
#include <linux/slab.h>
+#include <linux/mutex.h>
+
#include <asm/uaccess.h>
#include "base.h"
@@ -315,8 +318,6 @@ static ssize_t pnp_show_current_resources(struct device *dmdev,
return ret;
}
-extern struct semaphore pnp_res_mutex;
-
static ssize_t
pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
const char *ubuf, size_t count)
@@ -361,10 +362,10 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
goto done;
}
if (!strnicmp(buf, "get", 3)) {
- down(&pnp_res_mutex);
+ mutex_lock(&pnp_res_mutex);
if (pnp_can_read(dev))
dev->protocol->get(dev, &dev->res);
- up(&pnp_res_mutex);
+ mutex_unlock(&pnp_res_mutex);
goto done;
}
if (!strnicmp(buf, "set", 3)) {
@@ -373,7 +374,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
goto done;
buf += 3;
pnp_init_resource_table(&dev->res);
- down(&pnp_res_mutex);
+ mutex_lock(&pnp_res_mutex);
while (1) {
while (isspace(*buf))
++buf;
@@ -455,7 +456,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
}
break;
}
- up(&pnp_res_mutex);
+ mutex_unlock(&pnp_res_mutex);
goto done;
}