RDMA/hns: Refactor hns RoCE debugfs
driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I8GHCT -------------------------------------------------------------------------- Debugfs provides debugfs_remove_recursive() to remove all the debugfs files and directories below the specified directory. With this function, debugfs users don't need to clean up each file one by one. This patch refactors debugfs codes, removes all the redundant debugfs removal operations, and just cleans up all files recursively below the device directory when the device is being uninited. To accomplish this, most of the hns debugfs struct pointers are changed to struct variables, so that driver don't need to care about the tedious memory releasing stuff when recursively removing the whole device debugfs directory. There are two special cases: 1. The DCA uctx debugfs should be removed when the uctx is deallocated, rather than being removed along with the device directory; 2. The number of poe channels isn't fixed, so an array of these debugfs directories are dynamically allocated, and should be released when removing the device directory. Signed-off-by:Junxian Huang <huangjunxian6@hisilicon.com>
Loading
Please sign in to comment