aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-22 10:21:28 -0500
committerKalle Valo <kvalo@codeaurora.org>2019-02-01 07:34:56 -0500
commit80f4c5e3662adad45d63dbf9bd9d524304c3eb1c (patch)
treea49538328528898abf1c64f261265065ba990a66
parentb089e6944af34be0e3a0345903e82b4bdc01c4af (diff)
cw1200: no need to check return value of debugfs_create functions
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>
-rw-r--r--drivers/net/wireless/st/cw1200/debug.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/net/wireless/st/cw1200/debug.c b/drivers/net/wireless/st/cw1200/debug.c
index 2231ba08bc1f..d94266d9d0b8 100644
--- a/drivers/net/wireless/st/cw1200/debug.c
+++ b/drivers/net/wireless/st/cw1200/debug.c
@@ -371,28 +371,14 @@ int cw1200_debug_init(struct cw1200_common *priv)
371 371
372 d->debugfs_phy = debugfs_create_dir("cw1200", 372 d->debugfs_phy = debugfs_create_dir("cw1200",
373 priv->hw->wiphy->debugfsdir); 373 priv->hw->wiphy->debugfsdir);
374 if (!d->debugfs_phy) 374 debugfs_create_file("status", 0400, d->debugfs_phy, priv,
375 goto err; 375 &cw1200_status_fops);
376 376 debugfs_create_file("counters", 0400, d->debugfs_phy, priv,
377 if (!debugfs_create_file("status", 0400, d->debugfs_phy, 377 &cw1200_counters_fops);
378 priv, &cw1200_status_fops)) 378 debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, priv,
379 goto err; 379 &fops_wsm_dumps);
380
381 if (!debugfs_create_file("counters", 0400, d->debugfs_phy,
382 priv, &cw1200_counters_fops))
383 goto err;
384
385 if (!debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy,
386 priv, &fops_wsm_dumps))
387 goto err;
388 380
389 return 0; 381 return 0;
390
391err:
392 priv->debug = NULL;
393 debugfs_remove_recursive(d->debugfs_phy);
394 kfree(d);
395 return ret;
396} 382}
397 383
398void cw1200_debug_release(struct cw1200_common *priv) 384void cw1200_debug_release(struct cw1200_common *priv)