On Fri, Dec 04, 2020 at 04:57:16PM -0800, Thierry Strudel wrote:
> debugfs nodes were created in genpd_debug_init alled in late_initcall
> preventing power domains registered though loadable modules to have
> a debugfs entry.
> 
> Create/remove debugfs nodes when the power domain is added/removed
> to/from the internal gpd_list.
> 
> Signed-off-by: Thierry Strudel <tstru...@google.com>
> ---
> v2: fix forward declaration and genpd_debugfs_dir being NULL - Ulf
> v3: remove extra trailing char added by mistake in v2 - kernel test robot 
>  drivers/base/power/domain.c | 83 ++++++++++++++++++++++++-------------
>  1 file changed, 55 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 743268996336..3e40ef5cd9ab 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -24,6 +24,16 @@
>  
>  #include "power.h"
>  
> +#ifdef CONFIG_DEBUG_FS
> +#include <linux/pm.h>
> +#include <linux/device.h>
> +#include <linux/debugfs.h>
> +#include <linux/seq_file.h>
> +#include <linux/init.h>
> +#include <linux/kobject.h>

Why do you need all of these files included for debugfs stuff?

And why put it in a #ifdef at all?  Include files are not normally gated
that way.

> +static struct dentry *genpd_debugfs_dir;

That's the variable you want to only have declared or not, just #ifdef
for this :)

thanks,

greg k-h

Reply via email to