diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-08 22:15:13 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:35 -0400 |
commit | 48fde701aff662559b38d9a609574068f22d00fe (patch) | |
tree | aa6b203dc671b51d58575b65eb08310ff8309b60 /drivers/usb | |
parent | 6b4231e2f92adbcf96fb2a3fa751d7ca0a61b21f (diff) |
switch open-coded instances of d_make_root() to new helper
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/inode.c | 9 | ||||
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/inode.c | 4 |
3 files changed, 4 insertions, 17 deletions
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 9e186f3da839..bdaef8e36020 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -462,16 +462,9 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent) | |||
462 | sb->s_op = &usbfs_ops; | 462 | sb->s_op = &usbfs_ops; |
463 | sb->s_time_gran = 1; | 463 | sb->s_time_gran = 1; |
464 | inode = usbfs_get_inode(sb, S_IFDIR | 0755, 0); | 464 | inode = usbfs_get_inode(sb, S_IFDIR | 0755, 0); |
465 | 465 | root = d_make_root(inode); | |
466 | if (!inode) { | ||
467 | dbg("%s: could not get inode!",__func__); | ||
468 | return -ENOMEM; | ||
469 | } | ||
470 | |||
471 | root = d_alloc_root(inode); | ||
472 | if (!root) { | 466 | if (!root) { |
473 | dbg("%s: could not get root dentry!",__func__); | 467 | dbg("%s: could not get root dentry!",__func__); |
474 | iput(inode); | ||
475 | return -ENOMEM; | 468 | return -ENOMEM; |
476 | } | 469 | } |
477 | sb->s_root = root; | 470 | sb->s_root = root; |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index f63dc6c150d2..d825b248728a 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -1063,13 +1063,9 @@ static int ffs_sb_fill(struct super_block *sb, void *_data, int silent) | |||
1063 | &simple_dir_operations, | 1063 | &simple_dir_operations, |
1064 | &simple_dir_inode_operations, | 1064 | &simple_dir_inode_operations, |
1065 | &data->perms); | 1065 | &data->perms); |
1066 | if (unlikely(!inode)) | 1066 | sb->s_root = d_make_root(inode); |
1067 | if (unlikely(!sb->s_root)) | ||
1067 | goto Enomem; | 1068 | goto Enomem; |
1068 | sb->s_root = d_alloc_root(inode); | ||
1069 | if (unlikely(!sb->s_root)) { | ||
1070 | iput(inode); | ||
1071 | goto Enomem; | ||
1072 | } | ||
1073 | 1069 | ||
1074 | /* EP0 file */ | 1070 | /* EP0 file */ |
1075 | if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs, | 1071 | if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs, |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index ae04266dba1b..c95eea43b637 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -2059,10 +2059,8 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent) | |||
2059 | if (!inode) | 2059 | if (!inode) |
2060 | goto Enomem; | 2060 | goto Enomem; |
2061 | inode->i_op = &simple_dir_inode_operations; | 2061 | inode->i_op = &simple_dir_inode_operations; |
2062 | if (!(sb->s_root = d_alloc_root (inode))) { | 2062 | if (!(sb->s_root = d_make_root (inode))) |
2063 | iput(inode); | ||
2064 | goto Enomem; | 2063 | goto Enomem; |
2065 | } | ||
2066 | 2064 | ||
2067 | /* the ep0 file is named after the controller we expect; | 2065 | /* the ep0 file is named after the controller we expect; |
2068 | * user mode code can use it for sanity checks, like we do. | 2066 | * user mode code can use it for sanity checks, like we do. |