cw1200: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 15:21:28 +0000 (16:21 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 1 Feb 2019 12:34:56 +0000 (14:34 +0200)
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.

Cc: Solomon Peachy <pizza@shaftnet.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/st/cw1200/debug.c

index 2231ba08bc1fec576de45941d0c038d3785d1582..d94266d9d0b86d43a8682485acaf1ebdffb7e059 100644 (file)
@@ -371,28 +371,14 @@ int cw1200_debug_init(struct cw1200_common *priv)
 
        d->debugfs_phy = debugfs_create_dir("cw1200",
                                            priv->hw->wiphy->debugfsdir);
-       if (!d->debugfs_phy)
-               goto err;
-
-       if (!debugfs_create_file("status", 0400, d->debugfs_phy,
-                                priv, &cw1200_status_fops))
-               goto err;
-
-       if (!debugfs_create_file("counters", 0400, d->debugfs_phy,
-                                priv, &cw1200_counters_fops))
-               goto err;
-
-       if (!debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy,
-                                priv, &fops_wsm_dumps))
-               goto err;
+       debugfs_create_file("status", 0400, d->debugfs_phy, priv,
+                           &cw1200_status_fops);
+       debugfs_create_file("counters", 0400, d->debugfs_phy, priv,
+                           &cw1200_counters_fops);
+       debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, priv,
+                           &fops_wsm_dumps);
 
        return 0;
-
-err:
-       priv->debug = NULL;
-       debugfs_remove_recursive(d->debugfs_phy);
-       kfree(d);
-       return ret;
 }
 
 void cw1200_debug_release(struct cw1200_common *priv)