Commit b6643496 authored by Junxian Huang's avatar Junxian Huang Committed by Juan Zhou
Browse files

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: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
parent 3ca7635e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment