Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / arch / powerpc / kernel / rtas_flash.c
index f2276593f41648c7dc00330458622d63bca14b9b..0a5e22b22729f6b70443c1b0c9fb622aca4ea26e 100644 (file)
@@ -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;
        }
@@ -704,18 +704,11 @@ static int initialize_flash_pde_data(const char *rtas_call_name,
 static struct proc_dir_entry *create_flash_pde(const char *filename,
                                               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->proc_fops = fops;
-               ent->owner = THIS_MODULE;
-       }
-
-       return ent;
+       return proc_create(filename, S_IRUSR | S_IWUSR, NULL, fops);
 }
 
 static const struct file_operations rtas_flash_operations = {
+       .owner          = THIS_MODULE,
        .read           = rtas_flash_read,
        .write          = rtas_flash_write,
        .open           = rtas_excl_open,
@@ -723,6 +716,7 @@ static const struct file_operations rtas_flash_operations = {
 };
 
 static const struct file_operations manage_flash_operations = {
+       .owner          = THIS_MODULE,
        .read           = manage_flash_read,
        .write          = manage_flash_write,
        .open           = rtas_excl_open,
@@ -730,6 +724,7 @@ static const struct file_operations manage_flash_operations = {
 };
 
 static const struct file_operations validate_flash_operations = {
+       .owner          = THIS_MODULE,
        .read           = validate_flash_read,
        .write          = validate_flash_write,
        .open           = rtas_excl_open,
@@ -807,7 +802,7 @@ int __init rtas_flash_init(void)
                                rtas_block_ctor);
        if (!flash_block_cache) {
                printk(KERN_ERR "%s: failed to create block cache\n",
-                               __FUNCTION__);
+                               __func__);
                rc = -ENOMEM;
                goto cleanup;
        }