Skip to content

Commit 77b47f3

Browse files
plappermaulrobimarko
authored andcommitted
realtek: cleanup debugfs creation in serdes driver
debugfs_create_dir() has a proper logic to handle existing directories. Skip the manual test. Additionally quit early if directory creation fails. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: openwrt/openwrt#21157 Signed-off-by: Robert Marko <robimarko@gmail.com> (cherry picked from commit 3c073b5)
1 parent a53655e commit 77b47f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
155155
dbg_info->ctrl = ctrl;
156156
dbg_info->sds = sds;
157157

158-
root = debugfs_lookup(RTSDS_DBG_ROOT_DIR, NULL);
159-
if (!root)
160-
root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
158+
root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL);
159+
if (IS_ERR(root))
160+
return PTR_ERR(root);
161161

162162
snprintf(dirname, sizeof(dirname), "serdes.%d", sds);
163163
dir = debugfs_create_dir(dirname, root);

0 commit comments

Comments
 (0)