From 99de7079fe460dc12d751f58a6d410f0211d2f8c Mon Sep 17 00:00:00 2001 From: Li Huang Date: Thu, 17 Oct 2024 16:12:28 +0800 Subject: [PATCH] MALI: rockchip: Fix build warning after disable CONFIG_PM Change-Id: I23002ed6814f4dcdd3f071411907df9328f886b5 Signed-off-by: Li Huang --- .../platform/rk/mali_kbase_config_rk.c | 23 +++++++------------ drivers/gpu/arm/mali400/mali/platform/rk/rk.c | 2 +- .../platform/rk/mali_kbase_config_rk.c | 19 +++++---------- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c b/drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c index 07b300651b02..cb3f6979bb5d 100755 --- a/drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c +++ b/drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c @@ -201,7 +201,7 @@ struct kbase_platform_funcs_conf platform_funcs = { /*---------------------------------------------------------------------------*/ -static int rk_pm_callback_runtime_on(struct kbase_device *kbdev) +static __maybe_unused int rk_pm_callback_runtime_on(struct kbase_device *kbdev) { struct rockchip_opp_info *opp_info = &kbdev->opp_info; int ret = 0; @@ -226,7 +226,7 @@ static int rk_pm_callback_runtime_on(struct kbase_device *kbdev) return 0; } -static void rk_pm_callback_runtime_off(struct kbase_device *kbdev) +static __maybe_unused void rk_pm_callback_runtime_off(struct kbase_device *kbdev) { struct rockchip_opp_info *opp_info = &kbdev->opp_info; @@ -310,29 +310,22 @@ static void rk_pm_callback_power_off(struct kbase_device *kbdev) msecs_to_jiffies(platform->delay_ms)); } -static int rk_kbase_device_runtime_init(struct kbase_device *kbdev) +static __maybe_unused int rk_kbase_device_runtime_init(struct kbase_device *kbdev) { return 0; } -static void rk_kbase_device_runtime_disable(struct kbase_device *kbdev) +static __maybe_unused void rk_kbase_device_runtime_disable(struct kbase_device *kbdev) { } struct kbase_pm_callback_conf pm_callbacks = { .power_on_callback = rk_pm_callback_power_on, .power_off_callback = rk_pm_callback_power_off, -#ifdef CONFIG_PM - .power_runtime_init_callback = rk_kbase_device_runtime_init, - .power_runtime_term_callback = rk_kbase_device_runtime_disable, - .power_runtime_on_callback = rk_pm_callback_runtime_on, - .power_runtime_off_callback = rk_pm_callback_runtime_off, -#else /* CONFIG_PM */ - .power_runtime_init_callback = NULL, - .power_runtime_term_callback = NULL, - .power_runtime_on_callback = NULL, - .power_runtime_off_callback = NULL, -#endif /* CONFIG_PM */ + .power_runtime_init_callback = pm_ptr(rk_kbase_device_runtime_init), + .power_runtime_term_callback = pm_ptr(rk_kbase_device_runtime_disable), + .power_runtime_on_callback = pm_ptr(rk_pm_callback_runtime_on), + .power_runtime_off_callback = pm_ptr(rk_pm_callback_runtime_off), }; /*---------------------------------------------------------------------------*/ diff --git a/drivers/gpu/arm/mali400/mali/platform/rk/rk.c b/drivers/gpu/arm/mali400/mali/platform/rk/rk.c index 9027d6817501..edbdf8b5f0f7 100644 --- a/drivers/gpu/arm/mali400/mali/platform/rk/rk.c +++ b/drivers/gpu/arm/mali400/mali/platform/rk/rk.c @@ -404,7 +404,6 @@ static int power_model_simple_init(struct platform_device *pdev) /*---------------------------------------------------------------------------*/ -#ifdef CONFIG_PM static int rk_platform_enable_clk_gpu(struct device *dev) { @@ -516,6 +515,7 @@ void rk_platform_uninit_opp_table(struct mali_device *mdev) rockchip_uninit_opp_table(mdev->dev, &mdev->opp_info); } +#ifdef CONFIG_PM static int mali_runtime_suspend(struct device *device) { int ret = 0; diff --git a/drivers/gpu/arm/midgard/platform/rk/mali_kbase_config_rk.c b/drivers/gpu/arm/midgard/platform/rk/mali_kbase_config_rk.c index b5aedce68cb4..dcdf87345c00 100644 --- a/drivers/gpu/arm/midgard/platform/rk/mali_kbase_config_rk.c +++ b/drivers/gpu/arm/midgard/platform/rk/mali_kbase_config_rk.c @@ -169,12 +169,12 @@ struct kbase_platform_funcs_conf platform_funcs = { /*---------------------------------------------------------------------------*/ -static int rk_pm_callback_runtime_on(struct kbase_device *kbdev) +static __maybe_unused int rk_pm_callback_runtime_on(struct kbase_device *kbdev) { return 0; } -static void rk_pm_callback_runtime_off(struct kbase_device *kbdev) +static __maybe_unused void rk_pm_callback_runtime_off(struct kbase_device *kbdev) { } @@ -248,17 +248,10 @@ void rk_kbase_device_runtime_disable(struct kbase_device *kbdev) struct kbase_pm_callback_conf pm_callbacks = { .power_on_callback = rk_pm_callback_power_on, .power_off_callback = rk_pm_callback_power_off, -#ifdef CONFIG_PM - .power_runtime_init_callback = rk_kbase_device_runtime_init, - .power_runtime_term_callback = rk_kbase_device_runtime_disable, - .power_runtime_on_callback = rk_pm_callback_runtime_on, - .power_runtime_off_callback = rk_pm_callback_runtime_off, -#else /* CONFIG_PM */ - .power_runtime_init_callback = NULL, - .power_runtime_term_callback = NULL, - .power_runtime_on_callback = NULL, - .power_runtime_off_callback = NULL, -#endif /* CONFIG_PM */ + .power_runtime_init_callback = pm_ptr(rk_kbase_device_runtime_init), + .power_runtime_term_callback = pm_ptr(rk_kbase_device_runtime_disable), + .power_runtime_on_callback = pm_ptr(rk_pm_callback_runtime_on), + .power_runtime_off_callback = pm_ptr(rk_pm_callback_runtime_off), }; int kbase_platform_early_init(void)