@@ -1666,11 +1666,6 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd)
return -EIO;
dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir);
- if (IS_ERR(dir)) {
- dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n",
- nbd_name(nbd));
- return -EIO;
- }
config->dbg_dir = dir;
debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops);
@@ -1692,8 +1687,6 @@ static int nbd_dbg_init(void)
struct dentry *dbg_dir;
dbg_dir = debugfs_create_dir("nbd", NULL);
- if (IS_ERR(dbg_dir))
- return -EIO;
nbd_dbg_dir = dbg_dir;
@@ -451,8 +451,6 @@ static void pkt_debugfs_dev_new(struct pktcdvd_device *pd)
if (!pkt_debugfs_root)
return;
pd->dfs_d_root = debugfs_create_dir(pd->name, pkt_debugfs_root);
- if (IS_ERR(pd->dfs_d_root))
- return;
pd->dfs_f_info = debugfs_create_file("info", 0444,
pd->dfs_d_root, pd, &debug_fops);
This patch removes the error checking for debugfs_create_dir. Even if we get an error from this function, other debugfs APIs will handle the error value and doesn't crash in that case. Hence caller can safely ignore the errors that occur during the creation of debugfs nodes. Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com> --- drivers/block/nbd.c | 7 ------- drivers/block/pktcdvd.c | 2 -- 2 files changed, 9 deletions(-)