]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ieee802154/at86rf230.c
ieee802154: no need to check return value of debugfs_create functions
[linux.git] / drivers / net / ieee802154 / at86rf230.c
index 595cf7e2a65158a18b864ebe1e562949a30010db..7d67f41387f5577959839f902128b1777b4b51ee 100644 (file)
@@ -1626,24 +1626,16 @@ static int at86rf230_stats_show(struct seq_file *file, void *offset)
 }
 DEFINE_SHOW_ATTRIBUTE(at86rf230_stats);
 
-static int at86rf230_debugfs_init(struct at86rf230_local *lp)
+static void at86rf230_debugfs_init(struct at86rf230_local *lp)
 {
        char debugfs_dir_name[DNAME_INLINE_LEN + 1] = "at86rf230-";
-       struct dentry *stats;
 
        strncat(debugfs_dir_name, dev_name(&lp->spi->dev), DNAME_INLINE_LEN);
 
        at86rf230_debugfs_root = debugfs_create_dir(debugfs_dir_name, NULL);
-       if (!at86rf230_debugfs_root)
-               return -ENOMEM;
-
-       stats = debugfs_create_file("trac_stats", 0444,
-                                   at86rf230_debugfs_root, lp,
-                                   &at86rf230_stats_fops);
-       if (!stats)
-               return -ENOMEM;
 
-       return 0;
+       debugfs_create_file("trac_stats", 0444, at86rf230_debugfs_root, lp,
+                           &at86rf230_stats_fops);
 }
 
 static void at86rf230_debugfs_remove(void)
@@ -1651,7 +1643,7 @@ static void at86rf230_debugfs_remove(void)
        debugfs_remove_recursive(at86rf230_debugfs_root);
 }
 #else
-static int at86rf230_debugfs_init(struct at86rf230_local *lp) { return 0; }
+static void at86rf230_debugfs_init(struct at86rf230_local *lp) { }
 static void at86rf230_debugfs_remove(void) { }
 #endif
 
@@ -1751,9 +1743,7 @@ static int at86rf230_probe(struct spi_device *spi)
        /* going into sleep by default */
        at86rf230_sleep(lp);
 
-       rc = at86rf230_debugfs_init(lp);
-       if (rc)
-               goto free_dev;
+       at86rf230_debugfs_init(lp);
 
        rc = ieee802154_register_hw(lp->hw);
        if (rc)