diff options
| author | Markus Stockhausen | 2025-12-14 09:03:47 +0000 |
|---|---|---|
| committer | Robert Marko | 2025-12-15 08:30:03 +0000 |
| commit | 77b47f33e58da08d7038457972341460c9d30632 (patch) | |
| tree | a8126e0a334a7c071fe172c7f72bccd9bd2e65af | |
| parent | a53655ed143ef5adb383cbb3b945197e7365d628 (diff) | |
| download | openwrt-77b47f33e58da08d7038457972341460c9d30632.tar.gz | |
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: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 3c073b5cb208e9ca77a786f38dc941316ee25c67)
| -rw-r--r-- | target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c index 2bd38f382d..394af71250 100644 --- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c +++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c @@ -155,9 +155,9 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds) dbg_info->ctrl = ctrl; dbg_info->sds = sds; - root = debugfs_lookup(RTSDS_DBG_ROOT_DIR, NULL); - if (!root) - root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL); + root = debugfs_create_dir(RTSDS_DBG_ROOT_DIR, NULL); + if (IS_ERR(root)) + return PTR_ERR(root); snprintf(dirname, sizeof(dirname), "serdes.%d", sds); dir = debugfs_create_dir(dirname, root); |