]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pnp/interface.c
ARM: OMAP: HSMMC: enable use as a module
[linux-2.6-omap-h63xx.git] / drivers / pnp / interface.c
index a0cfb75bbb8d72e82fbf74cfbd992ddce08f5245..982658477a58b4695df2ac979b00090cba9b1101 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * interface.c - contains everything related to the user interface
  *
- * Some code, especially possible resource dumping is based on isapnp_proc.c (c) Jaroslav Kysela <perex@suse.cz>
+ * Some code, especially possible resource dumping is based on isapnp_proc.c (c) Jaroslav Kysela <perex@perex.cz>
  * Copyright 2002 Adam Belay <ambx1@neo.rr.com>
  */
 
 #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)
@@ -327,8 +328,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
 
        if (dev->status & PNP_ATTACHED) {
                retval = -EBUSY;
-               pnp_info("Device %s cannot be configured because it is in use.",
-                        dev->dev.bus_id);
+               dev_info(&dev->dev, "in use; can't configure\n");
                goto done;
        }
 
@@ -362,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)) {
@@ -374,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;
@@ -456,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;
        }