]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86: amd: pmf: sps: Use devm_platform_profile_register()
authorKurt Borja <kuurtb@gmail.com>
Thu, 16 Jan 2025 00:27:10 +0000 (19:27 -0500)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 16 Jan 2025 15:26:35 +0000 (17:26 +0200)
Replace platform_profile_register() with it's device managed version.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20250116002721.75592-9-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/pmf/core.c
drivers/platform/x86/amd/pmf/pmf.h
drivers/platform/x86/amd/pmf/sps.c

index 57ee95a327be51e397fdb75226e434d6e2015223..1211a753fee84c8a8b660d47c88d3fa1521e19c1 100644 (file)
@@ -371,7 +371,6 @@ static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
        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);
-               amd_pmf_deinit_sps(dev);
        }
 
        if (dev->smart_pc_enabled) {
index 080818dd173ba305a7b28b7fdb43b8455c51ac7f..d99b3556205b1fc93f63c078ac0a59953be508fd 100644 (file)
@@ -780,7 +780,6 @@ int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf);
 void amd_pmf_update_slider(struct amd_pmf_dev *dev, bool op, int idx,
                           struct amd_pmf_static_slider_granular *table);
 int amd_pmf_init_sps(struct amd_pmf_dev *dev);
-void amd_pmf_deinit_sps(struct amd_pmf_dev *dev);
 int apmf_get_static_slider_granular(struct amd_pmf_dev *pdev,
                                    struct apmf_static_slider_granular_output *output);
 bool is_pprof_balanced(struct amd_pmf_dev *pmf);
index e710405b581f010007382d58c357b91aebde2968..7c7ed2b9de01182e66ebd9a5b89f5e2ee41a1599 100644 (file)
@@ -425,15 +425,10 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev)
        dev->pprof.ops = &amd_pmf_profile_ops;
 
        /* Create platform_profile structure and register */
-       err = platform_profile_register(&dev->pprof, dev);
+       err = devm_platform_profile_register(&dev->pprof, dev);
        if (err)
                dev_err(dev->dev, "Failed to register SPS support, this is most likely an SBIOS bug: %d\n",
                        err);
 
        return err;
 }
-
-void amd_pmf_deinit_sps(struct amd_pmf_dev *dev)
-{
-       platform_profile_remove(&dev->pprof);
-}