Skip to content

Commit 4dbd6e6

Browse files
superm1jwrdegoede
authored andcommitted
platform/x86/amd/pmf: Fix a missing cleanup path
On systems that support slider notifications but don't otherwise support granular slider the SPS cleanup path doesn't run. This means that loading/unloading/loading leads to failures because the sysfs files don't get setup properly when reloaded. Add the missing cleanup path. Fixes: 33c9ab5 ("platform/x86/amd/pmf: Notify OS power slider update") Signed-off-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 39ab0ba commit 4dbd6e6

File tree

1 file changed

+2
-1
lines changed
  • drivers/platform/x86/amd/pmf

1 file changed

+2
-1
lines changed

drivers/platform/x86/amd/pmf/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
324324

325325
static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
326326
{
327-
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) {
327+
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR) ||
328+
is_apmf_func_supported(dev, APMF_FUNC_OS_POWER_SLIDER_UPDATE)) {
328329
power_supply_unreg_notifier(&dev->pwr_src_notifier);
329330
amd_pmf_deinit_sps(dev);
330331
}

0 commit comments

Comments
 (0)