aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-07-19 10:09:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-03 22:52:50 -0400
commit0507c78ae80073ace05ffead661ab8bc85e2940c (patch)
tree9452f968f05ceb93e0cd68c138e3a4686c3b7ae0 /drivers/misc
parenta118cfdf993a67a95d9a68452bc10b0604de7177 (diff)
ibmasmfs: don't bother passing superblock when not needed
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/ibmasm/ibmasmfs.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index ce5b75616b45..e8b933111e0d 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -149,8 +149,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
149 return ret; 149 return ret;
150} 150}
151 151
152static struct dentry *ibmasmfs_create_file (struct super_block *sb, 152static struct dentry *ibmasmfs_create_file(struct dentry *parent,
153 struct dentry *parent,
154 const char *name, 153 const char *name,
155 const struct file_operations *fops, 154 const struct file_operations *fops,
156 void *data, 155 void *data,
@@ -163,7 +162,7 @@ static struct dentry *ibmasmfs_create_file (struct super_block *sb,
163 if (!dentry) 162 if (!dentry)
164 return NULL; 163 return NULL;
165 164
166 inode = ibmasmfs_make_inode(sb, S_IFREG | mode); 165 inode = ibmasmfs_make_inode(parent->d_sb, S_IFREG | mode);
167 if (!inode) { 166 if (!inode) {
168 dput(dentry); 167 dput(dentry);
169 return NULL; 168 return NULL;
@@ -176,8 +175,7 @@ static struct dentry *ibmasmfs_create_file (struct super_block *sb,
176 return dentry; 175 return dentry;
177} 176}
178 177
179static struct dentry *ibmasmfs_create_dir (struct super_block *sb, 178static struct dentry *ibmasmfs_create_dir(struct dentry *parent,
180 struct dentry *parent,
181 const char *name) 179 const char *name)
182{ 180{
183 struct dentry *dentry; 181 struct dentry *dentry;
@@ -187,7 +185,7 @@ static struct dentry *ibmasmfs_create_dir (struct super_block *sb,
187 if (!dentry) 185 if (!dentry)
188 return NULL; 186 return NULL;
189 187
190 inode = ibmasmfs_make_inode(sb, S_IFDIR | 0500); 188 inode = ibmasmfs_make_inode(parent->d_sb, S_IFDIR | 0500);
191 if (!inode) { 189 if (!inode) {
192 dput(dentry); 190 dput(dentry);
193 return NULL; 191 return NULL;
@@ -612,20 +610,20 @@ static void ibmasmfs_create_files (struct super_block *sb)
612 struct dentry *dir; 610 struct dentry *dir;
613 struct dentry *remote_dir; 611 struct dentry *remote_dir;
614 sp = list_entry(entry, struct service_processor, node); 612 sp = list_entry(entry, struct service_processor, node);
615 dir = ibmasmfs_create_dir(sb, sb->s_root, sp->dirname); 613 dir = ibmasmfs_create_dir(sb->s_root, sp->dirname);
616 if (!dir) 614 if (!dir)
617 continue; 615 continue;
618 616
619 ibmasmfs_create_file(sb, dir, "command", &command_fops, sp, S_IRUSR|S_IWUSR); 617 ibmasmfs_create_file(dir, "command", &command_fops, sp, S_IRUSR|S_IWUSR);
620 ibmasmfs_create_file(sb, dir, "event", &event_fops, sp, S_IRUSR|S_IWUSR); 618 ibmasmfs_create_file(dir, "event", &event_fops, sp, S_IRUSR|S_IWUSR);
621 ibmasmfs_create_file(sb, dir, "reverse_heartbeat", &r_heartbeat_fops, sp, S_IRUSR|S_IWUSR); 619 ibmasmfs_create_file(dir, "reverse_heartbeat", &r_heartbeat_fops, sp, S_IRUSR|S_IWUSR);
622 620
623 remote_dir = ibmasmfs_create_dir(sb, dir, "remote_video"); 621 remote_dir = ibmasmfs_create_dir(dir, "remote_video");
624 if (!remote_dir) 622 if (!remote_dir)
625 continue; 623 continue;
626 624
627 ibmasmfs_create_file(sb, remote_dir, "width", &remote_settings_fops, (void *)display_width(sp), S_IRUSR|S_IWUSR); 625 ibmasmfs_create_file(remote_dir, "width", &remote_settings_fops, (void *)display_width(sp), S_IRUSR|S_IWUSR);
628 ibmasmfs_create_file(sb, remote_dir, "height", &remote_settings_fops, (void *)display_height(sp), S_IRUSR|S_IWUSR); 626 ibmasmfs_create_file(remote_dir, "height", &remote_settings_fops, (void *)display_height(sp), S_IRUSR|S_IWUSR);
629 ibmasmfs_create_file(sb, remote_dir, "depth", &remote_settings_fops, (void *)display_depth(sp), S_IRUSR|S_IWUSR); 627 ibmasmfs_create_file(remote_dir, "depth", &remote_settings_fops, (void *)display_depth(sp), S_IRUSR|S_IWUSR);
630 } 628 }
631} 629}