]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mwifiex: debugfs: Drop unnecessary error check for debugfs_create_dir()
authorJinjie Ruan <ruanjinjie@huawei.com>
Sun, 3 Sep 2023 03:02:15 +0000 (11:02 +0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:21:49 +0000 (18:21 -0400)
[ Upstream commit 50180c7f8e3de7c2d87f619131776598fcb1478d ]

debugfs_create_dir() returns ERR_PTR and never return NULL.

As Russell suggested, this patch removes the error checking for
debugfs_create_dir(). This is because the DebugFS kernel API is developed
in a way that the caller can safely ignore the errors that occur during
the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in
start_creating() which can handle it gracefully. So these checks are
unnecessary.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20230903030216.1509013-3-ruanjinjie@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/marvell/mwifiex/debugfs.c

index 1e7dc724c6a94730d8aee046b5d65273c202770c..d48a3e0b360601c5c6b66e0ef0ec1080d56eb283 100644 (file)
@@ -976,9 +976,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
        priv->dfs_dev_dir = debugfs_create_dir(priv->netdev->name,
                                               mwifiex_dfs_dir);
 
-       if (!priv->dfs_dev_dir)
-               return;
-
        MWIFIEX_DFS_ADD_FILE(info);
        MWIFIEX_DFS_ADD_FILE(debug);
        MWIFIEX_DFS_ADD_FILE(getlog);