debugfs: Provide a file creation function that also takes an initial size
Provide a file creation function that also takes an initial size so that the caller doesn't have to set i_size, thus meaning that we don't have to call deal with ->d_inode in the callers. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Al Viro

vecāks
77b3da6e32
revīzija
e59b4e9187
@@ -264,14 +264,17 @@ static void usba_init_debugfs(struct usba_udc *udc)
|
||||
goto err_root;
|
||||
udc->debugfs_root = root;
|
||||
|
||||
regs = debugfs_create_file("regs", 0400, root, udc, ®s_dbg_fops);
|
||||
if (!regs)
|
||||
goto err_regs;
|
||||
|
||||
regs_resource = platform_get_resource(udc->pdev, IORESOURCE_MEM,
|
||||
CTRL_IOMEM_ID);
|
||||
regs->d_inode->i_size = resource_size(regs_resource);
|
||||
udc->debugfs_regs = regs;
|
||||
|
||||
if (regs_resource) {
|
||||
regs = debugfs_create_file_size("regs", 0400, root, udc,
|
||||
®s_dbg_fops,
|
||||
resource_size(regs_resource));
|
||||
if (!regs)
|
||||
goto err_regs;
|
||||
udc->debugfs_regs = regs;
|
||||
}
|
||||
|
||||
usba_ep_init_debugfs(udc, to_usba_ep(udc->gadget.ep0));
|
||||
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user