Skip to content
Commit 9af48b26 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Hans de Goede
Browse files

platform/x86/amd: pmc: Fix build without debugfs



Without CONFIG_DEBUG_FS, the following build error occurs:

  drivers/platform/x86/amd/pmc.c:984:17: error: use of undeclared identifier 'pmc_groups'; did you mean 'set_groups'?
                  .dev_groups = pmc_groups,
                                ^~~~~~~~~~
                                set_groups
  ./include/linux/cred.h:65:13: note: 'set_groups' declared here
  extern void set_groups(struct cred *, struct group_info *);
              ^
  drivers/platform/x86/amd/pmc.c:984:17: error: incompatible pointer types initializing 'const struct attribute_group **' with an expression of type 'void (struct cred *, struct group_info *)' [-Werror,-Wincompatible-pointer-types]
                  .dev_groups = pmc_groups,
                                ^~~~~~~~~~
  2 errors generated.

pmc_groups was only defined inside a CONFIG_DEBUG_FS block but
commit 7f1ea75d ("platform/x86/amd: pmc: Add sysfs files for SMU")
intended for these sysfs files to be available outside of debugfs.
Shuffle the necessary functions out of the CONFIG_DEBUG_FS block so that
the file always builds.

Fixes: 7f1ea75d ("platform/x86/amd: pmc: Add sysfs files for SMU")
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220922153100.324922-1-nathan@kernel.org


Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 401199ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment