mmc: host: dw_mmc: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2019 08:25:30 +0000 (10:25 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Jun 2019 11:31:21 +0000 (13:31 +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: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc.c

index b53b6b7d4dd46abd07c4955fd13fb310026a309a..faaaf52a46d278409c2f183cea9969f75f90d069 100644 (file)
@@ -169,40 +169,18 @@ static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
        struct mmc_host *mmc = slot->mmc;
        struct dw_mci *host = slot->host;
        struct dentry *root;
-       struct dentry *node;
 
        root = mmc->debugfs_root;
        if (!root)
                return;
 
-       node = debugfs_create_file("regs", S_IRUSR, root, host,
-                                  &dw_mci_regs_fops);
-       if (!node)
-               goto err;
-
-       node = debugfs_create_file("req", S_IRUSR, root, slot,
-                                  &dw_mci_req_fops);
-       if (!node)
-               goto err;
-
-       node = debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state);
-       if (!node)
-               goto err;
-
-       node = debugfs_create_x32("pending_events", S_IRUSR, root,
-                                 (u32 *)&host->pending_events);
-       if (!node)
-               goto err;
-
-       node = debugfs_create_x32("completed_events", S_IRUSR, root,
-                                 (u32 *)&host->completed_events);
-       if (!node)
-               goto err;
-
-       return;
-
-err:
-       dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n");
+       debugfs_create_file("regs", S_IRUSR, root, host, &dw_mci_regs_fops);
+       debugfs_create_file("req", S_IRUSR, root, slot, &dw_mci_req_fops);
+       debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state);
+       debugfs_create_x32("pending_events", S_IRUSR, root,
+                          (u32 *)&host->pending_events);
+       debugfs_create_x32("completed_events", S_IRUSR, root,
+                          (u32 *)&host->completed_events);
 }
 #endif /* defined(CONFIG_DEBUG_FS) */