mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
platform/x86/amd/pmf: Fix a missing cleanup path
[ Upstream commit4dbd6e61ad] 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:33c9ab5b49("platform/x86/amd/pmf: Notify OS power slider update") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20230823185421.23959-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2763732ec1
commit
69b8d7bf83
@@ -322,7 +322,8 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
|
|||||||
|
|
||||||
static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
|
static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
|
||||||
{
|
{
|
||||||
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) {
|
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR) ||
|
||||||
|
is_apmf_func_supported(dev, APMF_FUNC_OS_POWER_SLIDER_UPDATE)) {
|
||||||
power_supply_unreg_notifier(&dev->pwr_src_notifier);
|
power_supply_unreg_notifier(&dev->pwr_src_notifier);
|
||||||
amd_pmf_deinit_sps(dev);
|
amd_pmf_deinit_sps(dev);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user