diff mbox series

[v1,4/4] hte: tegra194: Switch to LATE_SIMPLE_DEV_PM_OPS()

Message ID 20231010151709.4104747-5-andriy.shevchenko@linux.intel.com
State New
Headers show
Series hte: Improve GPIO handling and other cleanups | expand

Commit Message

Andy Shevchenko Oct. 10, 2023, 3:17 p.m. UTC
SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with
LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting
the driver's pm routines. We can now remove the __maybe_unused
qualifier in the suspend and resume functions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hte/hte-tegra194.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Dipen Patel Oct. 10, 2023, 7:36 p.m. UTC | #1
On 10/10/23 8:17 AM, Andy Shevchenko wrote:
> SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with
> LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting
> the driver's pm routines. We can now remove the __maybe_unused
> qualifier in the suspend and resume functions.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/hte/hte-tegra194.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c
> index 30ef1750a9fa..30fa7c0a555e 100644
> --- a/drivers/hte/hte-tegra194.c
> +++ b/drivers/hte/hte-tegra194.c
> @@ -815,7 +815,7 @@ static int tegra_hte_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int __maybe_unused tegra_hte_resume_early(struct device *dev)
> +static int tegra_hte_resume_early(struct device *dev)
>  {
>  	u32 i;
>  	struct tegra_hte_soc *gs = dev_get_drvdata(dev);
> @@ -836,7 +836,7 @@ static int __maybe_unused tegra_hte_resume_early(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused tegra_hte_suspend_late(struct device *dev)
> +static int tegra_hte_suspend_late(struct device *dev)
>  {
>  	u32 i;
>  	struct tegra_hte_soc *gs = dev_get_drvdata(dev);
> @@ -856,15 +856,14 @@ static int __maybe_unused tegra_hte_suspend_late(struct device *dev)
>  }
>  
>  static const struct dev_pm_ops tegra_hte_pm = {
> -	SET_LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late,
> -				     tegra_hte_resume_early)
> +	LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late, tegra_hte_resume_early)
>  };
>  
>  static struct platform_driver tegra_hte_driver = {
>  	.probe = tegra_hte_probe,
>  	.driver = {
>  		.name = "tegra_hte",
> -		.pm = &tegra_hte_pm,
> +		.pm = pm_slee_ptr(&tegra_hte_pm),

typo, pm_sleep_ptr instead?

>  		.of_match_table = tegra_hte_of_match,
>  	},
>  };
Andy Shevchenko Oct. 11, 2023, 5:55 a.m. UTC | #2
On Tue, Oct 10, 2023 at 10:36 PM Dipen Patel <dipenp@nvidia.com> wrote:
> On 10/10/23 8:17 AM, Andy Shevchenko wrote:

> > +             .pm = pm_slee_ptr(&tegra_hte_pm),
>
> typo, pm_sleep_ptr instead?

Indeed. On my x86_64 this code slipped from compilation. I will try
harder to compile-test it next time.
Dipen Patel Oct. 11, 2023, 6:06 p.m. UTC | #3
On 10/10/23 10:55 PM, Andy Shevchenko wrote:
> On Tue, Oct 10, 2023 at 10:36 PM Dipen Patel <dipenp@nvidia.com> wrote:
>> On 10/10/23 8:17 AM, Andy Shevchenko wrote:
> 
>>> +             .pm = pm_slee_ptr(&tegra_hte_pm),
>>
>> typo, pm_sleep_ptr instead?
> 
> Indeed. On my x86_64 this code slipped from compilation. I will try
> harder to compile-test it next time.
> 
After manually correcting the error,

Tested-by: Dipen Patel <dipenp@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/hte/hte-tegra194.c b/drivers/hte/hte-tegra194.c
index 30ef1750a9fa..30fa7c0a555e 100644
--- a/drivers/hte/hte-tegra194.c
+++ b/drivers/hte/hte-tegra194.c
@@ -815,7 +815,7 @@  static int tegra_hte_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused tegra_hte_resume_early(struct device *dev)
+static int tegra_hte_resume_early(struct device *dev)
 {
 	u32 i;
 	struct tegra_hte_soc *gs = dev_get_drvdata(dev);
@@ -836,7 +836,7 @@  static int __maybe_unused tegra_hte_resume_early(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused tegra_hte_suspend_late(struct device *dev)
+static int tegra_hte_suspend_late(struct device *dev)
 {
 	u32 i;
 	struct tegra_hte_soc *gs = dev_get_drvdata(dev);
@@ -856,15 +856,14 @@  static int __maybe_unused tegra_hte_suspend_late(struct device *dev)
 }
 
 static const struct dev_pm_ops tegra_hte_pm = {
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late,
-				     tegra_hte_resume_early)
+	LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late, tegra_hte_resume_early)
 };
 
 static struct platform_driver tegra_hte_driver = {
 	.probe = tegra_hte_probe,
 	.driver = {
 		.name = "tegra_hte",
-		.pm = &tegra_hte_pm,
+		.pm = pm_slee_ptr(&tegra_hte_pm),
 		.of_match_table = tegra_hte_of_match,
 	},
 };