Skip to contentSkip to conversation

USB: mtu3: no need to check return value of debugfs_create_dir()

PATCH New Greg Kroah-Hartman 1 participant 1 message May 29, 2018

Subsystems (2)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 4/22 USB: mtu3: no need to check return value of debugfs_create_dir()

When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this.

---
 drivers/usb/mtu3/mtu3_dr.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/mtu3/mtu3_dr.c +0 -4
index 8c3bbf732bc4..ac60e9c8564e 100644
@@ -378,10 +378,6 @@ static void ssusb_debugfs_init(struct ssusb_mtk *ssusb)
 	struct dentry *root;
 
 	root = debugfs_create_dir(dev_name(ssusb->dev), usb_debug_root);
-	if (!root) {
-		dev_err(ssusb->dev, "create debugfs root failed\n");
-		return;
-	}
 	ssusb->dbgfs_root = root;
 
 	debugfs_create_file("mode", 0644, root, ssusb, &ssusb_mode_fops);