aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 05:28:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 05:28:42 -0400
commit77c688ac87183537ed0fb84ec2cb8fa8ec97c458 (patch)
treed18e117e05c0d71463823536165ddd9ad75b6bc5 /drivers/usb/gadget/function
parent5e40d331bd72447197f26525f21711c4a265b6a6 (diff)
parenta457606a6f81cfddfc9da1ef2a8bf2c65a8eb35e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "The big thing in this pile is Eric's unmount-on-rmdir series; we finally have everything we need for that. The final piece of prereqs is delayed mntput() - now filesystem shutdown always happens on shallow stack. Other than that, we have several new primitives for iov_iter (Matt Wilcox, culled from his XIP-related series) pushing the conversion to ->read_iter()/ ->write_iter() a bit more, a bunch of fs/dcache.c cleanups and fixes (including the external name refcounting, which gives consistent behaviour of d_move() wrt procfs symlinks for long and short names alike) and assorted cleanups and fixes all over the place. This is just the first pile; there's a lot of stuff from various people that ought to go in this window. Starting with unionmount/overlayfs mess... ;-/" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (60 commits) fs/file_table.c: Update alloc_file() comment vfs: Deduplicate code shared by xattr system calls operating on paths reiserfs: remove pointless forward declaration of struct nameidata don't need that forward declaration of struct nameidata in dcache.h anymore take dname_external() into fs/dcache.c let path_init() failures treated the same way as subsequent link_path_walk() fix misuses of f_count() in ppp and netlink ncpfs: use list_for_each_entry() for d_subdirs walk vfs: move getname() from callers to do_mount() gfs2_atomic_open(): skip lookups on hashed dentry [infiniband] remove pointless assignments gadgetfs: saner API for gadgetfs_create_file() f_fs: saner API for ffs_sb_create_file() jfs: don't hash direct inode [s390] remove pointless assignment of ->f_op in vmlogrdr ->open() ecryptfs: ->f_op is never NULL android: ->f_op is never NULL nouveau: __iomem misannotations missing annotation in fs/file.c fs: namespace: suppress 'may be used uninitialized' warnings ...
Diffstat (limited to 'drivers/usb/gadget/function')
-rw-r--r--drivers/usb/gadget/function/f_fs.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 4ad11e03cf54..7c6771d027a2 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -164,10 +164,9 @@ struct ffs_desc_helper {
164static int __must_check ffs_epfiles_create(struct ffs_data *ffs); 164static int __must_check ffs_epfiles_create(struct ffs_data *ffs);
165static void ffs_epfiles_destroy(struct ffs_epfile *epfiles, unsigned count); 165static void ffs_epfiles_destroy(struct ffs_epfile *epfiles, unsigned count);
166 166
167static struct inode *__must_check 167static struct dentry *
168ffs_sb_create_file(struct super_block *sb, const char *name, void *data, 168ffs_sb_create_file(struct super_block *sb, const char *name, void *data,
169 const struct file_operations *fops, 169 const struct file_operations *fops);
170 struct dentry **dentry_p);
171 170
172/* Devices management *******************************************************/ 171/* Devices management *******************************************************/
173 172
@@ -1119,10 +1118,9 @@ ffs_sb_make_inode(struct super_block *sb, void *data,
1119} 1118}
1120 1119
1121/* Create "regular" file */ 1120/* Create "regular" file */
1122static struct inode *ffs_sb_create_file(struct super_block *sb, 1121static struct dentry *ffs_sb_create_file(struct super_block *sb,
1123 const char *name, void *data, 1122 const char *name, void *data,
1124 const struct file_operations *fops, 1123 const struct file_operations *fops)
1125 struct dentry **dentry_p)
1126{ 1124{
1127 struct ffs_data *ffs = sb->s_fs_info; 1125 struct ffs_data *ffs = sb->s_fs_info;
1128 struct dentry *dentry; 1126 struct dentry *dentry;
@@ -1141,10 +1139,7 @@ static struct inode *ffs_sb_create_file(struct super_block *sb,
1141 } 1139 }
1142 1140
1143 d_add(dentry, inode); 1141 d_add(dentry, inode);
1144 if (dentry_p) 1142 return dentry;
1145 *dentry_p = dentry;
1146
1147 return inode;
1148} 1143}
1149 1144
1150/* Super block */ 1145/* Super block */
@@ -1189,7 +1184,7 @@ static int ffs_sb_fill(struct super_block *sb, void *_data, int silent)
1189 1184
1190 /* EP0 file */ 1185 /* EP0 file */
1191 if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs, 1186 if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs,
1192 &ffs_ep0_operations, NULL))) 1187 &ffs_ep0_operations)))
1193 return -ENOMEM; 1188 return -ENOMEM;
1194 1189
1195 return 0; 1190 return 0;
@@ -1561,9 +1556,10 @@ static int ffs_epfiles_create(struct ffs_data *ffs)
1561 sprintf(epfiles->name, "ep%02x", ffs->eps_addrmap[i]); 1556 sprintf(epfiles->name, "ep%02x", ffs->eps_addrmap[i]);
1562 else 1557 else
1563 sprintf(epfiles->name, "ep%u", i); 1558 sprintf(epfiles->name, "ep%u", i);
1564 if (!unlikely(ffs_sb_create_file(ffs->sb, epfiles->name, epfile, 1559 epfile->dentry = ffs_sb_create_file(ffs->sb, epfiles->name,
1565 &ffs_epfile_operations, 1560 epfile,
1566 &epfile->dentry))) { 1561 &ffs_epfile_operations);
1562 if (unlikely(!epfile->dentry)) {
1567 ffs_epfiles_destroy(epfiles, i - 1); 1563 ffs_epfiles_destroy(epfiles, i - 1);
1568 return -ENOMEM; 1564 return -ENOMEM;
1569 } 1565 }