]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/rtas_flash.c
[POWERPC] irqtrace support for 64-bit powerpc
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / rtas_flash.c
index 0c4fcd34bfe585ce199271ec7f73fcc549e9d171..627f126d1848b4ec1f5e0eb2e2d8c5870bda93c5 100644 (file)
@@ -286,7 +286,7 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf,
 }
 
 /* constructor for flash_block_cache */
-void rtas_block_ctor(void *ptr, struct kmem_cache *cache, unsigned long flags)
+void rtas_block_ctor(struct kmem_cache *cache, void *ptr)
 {
        memset(ptr, 0, RTAS_BLK_SIZE);
 }
@@ -356,7 +356,7 @@ static int rtas_excl_open(struct inode *inode, struct file *file)
 
        /* Enforce exclusive open with use count of PDE */
        spin_lock(&flash_file_open_lock);
-       if (atomic_read(&dp->count) > 1) {
+       if (atomic_read(&dp->count) > 2) {
                spin_unlock(&flash_file_open_lock);
                return -EBUSY;
        }
@@ -702,13 +702,12 @@ static int initialize_flash_pde_data(const char *rtas_call_name,
 }
 
 static struct proc_dir_entry *create_flash_pde(const char *filename,
-                                              struct file_operations *fops)
+                                              const struct file_operations *fops)
 {
        struct proc_dir_entry *ent = NULL;
 
        ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL);
        if (ent != NULL) {
-               ent->nlink = 1;
                ent->proc_fops = fops;
                ent->owner = THIS_MODULE;
        }
@@ -716,21 +715,21 @@ static struct proc_dir_entry *create_flash_pde(const char *filename,
        return ent;
 }
 
-static struct file_operations rtas_flash_operations = {
+static const struct file_operations rtas_flash_operations = {
        .read           = rtas_flash_read,
        .write          = rtas_flash_write,
        .open           = rtas_excl_open,
        .release        = rtas_flash_release,
 };
 
-static struct file_operations manage_flash_operations = {
+static const struct file_operations manage_flash_operations = {
        .read           = manage_flash_read,
        .write          = manage_flash_write,
        .open           = rtas_excl_open,
        .release        = rtas_excl_release,
 };
 
-static struct file_operations validate_flash_operations = {
+static const struct file_operations validate_flash_operations = {
        .read           = validate_flash_read,
        .write          = validate_flash_write,
        .open           = rtas_excl_open,
@@ -805,10 +804,10 @@ int __init rtas_flash_init(void)
 
        flash_block_cache = kmem_cache_create("rtas_flash_cache",
                                RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
-                               rtas_block_ctor, NULL);
+                               rtas_block_ctor);
        if (!flash_block_cache) {
                printk(KERN_ERR "%s: failed to create block cache\n",
-                               __FUNCTION__);
+                               __func__);
                rc = -ENOMEM;
                goto cleanup;
        }