提交 798a2468 编写于 作者: D Dan Carpenter 提交者: Felipe Balbi

usb: gadget: gr_udc: remove some unneeded error handling

Debugfs function return an ERR_PTR if they compiled out.  We don't need
to test for that here because if the debugfs file are compiled out then
it is ok to pass an ERR_PTR to debugfs_create_file() since it will just
be a no-op stub.

Debugfs return NULLs on error, but we don't need to test for that either
because debugfs_create_file() will accept NULL pointers.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 3fcba0d8
......@@ -225,14 +225,8 @@ static void gr_dfs_create(struct gr_udc *dev)
const char *name = "gr_udc_state";
dev->dfs_root = debugfs_create_dir(dev_name(dev->dev), NULL);
if (IS_ERR(dev->dfs_root)) {
dev_err(dev->dev, "Failed to create debugfs directory\n");
return;
}
dev->dfs_state = debugfs_create_file(name, 0444, dev->dfs_root,
dev, &gr_dfs_fops);
if (IS_ERR(dev->dfs_state))
dev_err(dev->dev, "Failed to create debugfs file %s\n", name);
dev->dfs_state = debugfs_create_file(name, 0444, dev->dfs_root, dev,
&gr_dfs_fops);
}
static void gr_dfs_delete(struct gr_udc *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册