Merge branch 'linus' into x86/urgent
[pandora-kernel.git] / drivers / char / xilinx_hwicap / xilinx_hwicap.c
index 016f905..1e1b81e 100644 (file)
@@ -85,6 +85,7 @@
 #include <linux/poll.h>
 #include <linux/proc_fs.h>
 #include <linux/mutex.h>
+#include <linux/smp_lock.h>
 #include <linux/sysctl.h>
 #include <linux/version.h>
 #include <linux/fs.h>
@@ -504,11 +505,12 @@ static int hwicap_open(struct inode *inode, struct file *file)
        struct hwicap_drvdata *drvdata;
        int status;
 
+       lock_kernel();
        drvdata = container_of(inode->i_cdev, struct hwicap_drvdata, cdev);
 
        status = mutex_lock_interruptible(&drvdata->sem);
        if (status)
-               return status;
+               goto out;
 
        if (drvdata->is_open) {
                status = -EBUSY;
@@ -528,6 +530,8 @@ static int hwicap_open(struct inode *inode, struct file *file)
 
  error:
        mutex_unlock(&drvdata->sem);
+ out:
+       unlock_kernel();
        return status;
 }
 
@@ -623,8 +627,8 @@ static int __devinit hwicap_setup(struct device *dev, int id,
 
        if (!request_mem_region(drvdata->mem_start,
                                        drvdata->mem_size, DRIVER_NAME)) {
-               dev_err(dev, "Couldn't lock memory region at %p\n",
-                       (void *)regs_res->start);
+               dev_err(dev, "Couldn't lock memory region at %Lx\n",
+                       regs_res->start);
                retval = -EBUSY;
                goto failed1;
        }
@@ -643,7 +647,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
        mutex_init(&drvdata->sem);
        drvdata->is_open = 0;
 
-       dev_info(dev, "ioremap %lx to %p with size %x\n",
+       dev_info(dev, "ioremap %lx to %p with size %Lx\n",
                 (unsigned long int)drvdata->mem_start,
                        drvdata->base_address, drvdata->mem_size);
 
@@ -803,7 +807,7 @@ static int __devexit hwicap_of_remove(struct of_device *op)
 }
 
 /* Match table for of_platform binding */
-static const struct of_device_id __devinit hwicap_of_match[] = {
+static const struct of_device_id __devinitconst hwicap_of_match[] = {
        { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
        { .compatible = "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config},
        {},