summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-16 10:15:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-03 10:18:12 -0400
commita9a9da47f8e6c1fe24c8bfe36c7f5ee6fc3700a1 (patch)
tree72d0622327516aad7707ce615646d6438c638012
parent1c769fc41ac574e4957a6a874334eed1631e5f59 (diff)
mailbox: 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: Jassi Brar <jassisinghbrar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mailbox/bcm-flexrm-mailbox.c28
-rw-r--r--drivers/mailbox/bcm-pdc-mailbox.c8
2 files changed, 7 insertions, 29 deletions
diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c
index a64116586b4c..43b336316fde 100644
--- a/drivers/mailbox/bcm-flexrm-mailbox.c
+++ b/drivers/mailbox/bcm-flexrm-mailbox.c
@@ -296,8 +296,6 @@ struct flexrm_mbox {
296 struct dma_pool *bd_pool; 296 struct dma_pool *bd_pool;
297 struct dma_pool *cmpl_pool; 297 struct dma_pool *cmpl_pool;
298 struct dentry *root; 298 struct dentry *root;
299 struct dentry *config;
300 struct dentry *stats;
301 struct mbox_controller controller; 299 struct mbox_controller controller;
302}; 300};
303 301
@@ -1603,7 +1601,6 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
1603 1 << RING_CMPL_ALIGN_ORDER, 0); 1601 1 << RING_CMPL_ALIGN_ORDER, 0);
1604 if (!mbox->cmpl_pool) { 1602 if (!mbox->cmpl_pool) {
1605 ret = -ENOMEM; 1603 ret = -ENOMEM;
1606 goto fail_destroy_bd_pool;
1607 } 1604 }
1608 1605
1609 /* Allocate platform MSIs for each ring */ 1606 /* Allocate platform MSIs for each ring */
@@ -1624,28 +1621,15 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
1624 1621
1625 /* Create debugfs root entry */ 1622 /* Create debugfs root entry */
1626 mbox->root = debugfs_create_dir(dev_name(mbox->dev), NULL); 1623 mbox->root = debugfs_create_dir(dev_name(mbox->dev), NULL);
1627 if (IS_ERR_OR_NULL(mbox->root)) {
1628 ret = PTR_ERR_OR_ZERO(mbox->root);
1629 goto fail_free_msis;
1630 }
1631 1624
1632 /* Create debugfs config entry */ 1625 /* Create debugfs config entry */
1633 mbox->config = debugfs_create_devm_seqfile(mbox->dev, 1626 debugfs_create_devm_seqfile(mbox->dev, "config", mbox->root,
1634 "config", mbox->root, 1627 flexrm_debugfs_conf_show);
1635 flexrm_debugfs_conf_show);
1636 if (IS_ERR_OR_NULL(mbox->config)) {
1637 ret = PTR_ERR_OR_ZERO(mbox->config);
1638 goto fail_free_debugfs_root;
1639 }
1640 1628
1641 /* Create debugfs stats entry */ 1629 /* Create debugfs stats entry */
1642 mbox->stats = debugfs_create_devm_seqfile(mbox->dev, 1630 debugfs_create_devm_seqfile(mbox->dev, "stats", mbox->root,
1643 "stats", mbox->root, 1631 flexrm_debugfs_stats_show);
1644 flexrm_debugfs_stats_show); 1632
1645 if (IS_ERR_OR_NULL(mbox->stats)) {
1646 ret = PTR_ERR_OR_ZERO(mbox->stats);
1647 goto fail_free_debugfs_root;
1648 }
1649skip_debugfs: 1633skip_debugfs:
1650 1634
1651 /* Initialize mailbox controller */ 1635 /* Initialize mailbox controller */
@@ -1676,11 +1660,9 @@ skip_debugfs:
1676 1660
1677fail_free_debugfs_root: 1661fail_free_debugfs_root:
1678 debugfs_remove_recursive(mbox->root); 1662 debugfs_remove_recursive(mbox->root);
1679fail_free_msis:
1680 platform_msi_domain_free_irqs(dev); 1663 platform_msi_domain_free_irqs(dev);
1681fail_destroy_cmpl_pool: 1664fail_destroy_cmpl_pool:
1682 dma_pool_destroy(mbox->cmpl_pool); 1665 dma_pool_destroy(mbox->cmpl_pool);
1683fail_destroy_bd_pool:
1684 dma_pool_destroy(mbox->bd_pool); 1666 dma_pool_destroy(mbox->bd_pool);
1685fail: 1667fail:
1686 return ret; 1668 return ret;
diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c
index ccf3d62af7e7..a8c291386142 100644
--- a/drivers/mailbox/bcm-pdc-mailbox.c
+++ b/drivers/mailbox/bcm-pdc-mailbox.c
@@ -406,8 +406,6 @@ struct pdc_state {
406 */ 406 */
407 struct scatterlist *src_sg[PDC_RING_ENTRIES]; 407 struct scatterlist *src_sg[PDC_RING_ENTRIES];
408 408
409 struct dentry *debugfs_stats; /* debug FS stats file for this PDC */
410
411 /* counters */ 409 /* counters */
412 u32 pdc_requests; /* number of request messages submitted */ 410 u32 pdc_requests; /* number of request messages submitted */
413 u32 pdc_replies; /* number of reply messages received */ 411 u32 pdc_replies; /* number of reply messages received */
@@ -512,9 +510,8 @@ static void pdc_setup_debugfs(struct pdc_state *pdcs)
512 debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); 510 debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
513 511
514 /* S_IRUSR == 0400 */ 512 /* S_IRUSR == 0400 */
515 pdcs->debugfs_stats = debugfs_create_file(spu_stats_name, 0400, 513 debugfs_create_file(spu_stats_name, 0400, debugfs_dir, pdcs,
516 debugfs_dir, pdcs, 514 &pdc_debugfs_stats);
517 &pdc_debugfs_stats);
518} 515}
519 516
520static void pdc_free_debugfs(void) 517static void pdc_free_debugfs(void)
@@ -1614,7 +1611,6 @@ static int pdc_probe(struct platform_device *pdev)
1614 if (err) 1611 if (err)
1615 goto cleanup_buf_pool; 1612 goto cleanup_buf_pool;
1616 1613
1617 pdcs->debugfs_stats = NULL;
1618 pdc_setup_debugfs(pdcs); 1614 pdc_setup_debugfs(pdcs);
1619 1615
1620 dev_dbg(dev, "pdc_probe() successful"); 1616 dev_dbg(dev, "pdc_probe() successful");