Skip to content

Commit 22cf92b

Browse files
SherrySun5gregkh
authored andcommitted
tty: serial: fsl_lpuart: Use pm_ptr() to avoid need to make pm __maybe_unused
Use pm_ptr() to remove the need to mark the pm functions as __maybe_unused when the kernel is built without CONFIG_PM support. Signed-off-by: Sherry Sun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 43543e6 commit 22cf92b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,7 +2807,7 @@ static int lpuart_remove(struct platform_device *pdev)
28072807
return 0;
28082808
}
28092809

2810-
static int __maybe_unused lpuart_runtime_suspend(struct device *dev)
2810+
static int lpuart_runtime_suspend(struct device *dev)
28112811
{
28122812
struct platform_device *pdev = to_platform_device(dev);
28132813
struct lpuart_port *sport = platform_get_drvdata(pdev);
@@ -2817,7 +2817,7 @@ static int __maybe_unused lpuart_runtime_suspend(struct device *dev)
28172817
return 0;
28182818
};
28192819

2820-
static int __maybe_unused lpuart_runtime_resume(struct device *dev)
2820+
static int lpuart_runtime_resume(struct device *dev)
28212821
{
28222822
struct platform_device *pdev = to_platform_device(dev);
28232823
struct lpuart_port *sport = platform_get_drvdata(pdev);
@@ -2876,7 +2876,7 @@ static bool lpuart_uport_is_active(struct lpuart_port *sport)
28762876
return false;
28772877
}
28782878

2879-
static int __maybe_unused lpuart_suspend_noirq(struct device *dev)
2879+
static int lpuart_suspend_noirq(struct device *dev)
28802880
{
28812881
struct lpuart_port *sport = dev_get_drvdata(dev);
28822882
bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq));
@@ -2889,7 +2889,7 @@ static int __maybe_unused lpuart_suspend_noirq(struct device *dev)
28892889
return 0;
28902890
}
28912891

2892-
static int __maybe_unused lpuart_resume_noirq(struct device *dev)
2892+
static int lpuart_resume_noirq(struct device *dev)
28932893
{
28942894
struct lpuart_port *sport = dev_get_drvdata(dev);
28952895
unsigned int val;
@@ -2909,7 +2909,7 @@ static int __maybe_unused lpuart_resume_noirq(struct device *dev)
29092909
return 0;
29102910
}
29112911

2912-
static int __maybe_unused lpuart_suspend(struct device *dev)
2912+
static int lpuart_suspend(struct device *dev)
29132913
{
29142914
struct lpuart_port *sport = dev_get_drvdata(dev);
29152915
unsigned long temp, flags;
@@ -3005,7 +3005,7 @@ static void lpuart_console_fixup(struct lpuart_port *sport)
30053005
}
30063006
}
30073007

3008-
static int __maybe_unused lpuart_resume(struct device *dev)
3008+
static int lpuart_resume(struct device *dev)
30093009
{
30103010
struct lpuart_port *sport = dev_get_drvdata(dev);
30113011
int ret;
@@ -3030,11 +3030,11 @@ static int __maybe_unused lpuart_resume(struct device *dev)
30303030
}
30313031

30323032
static const struct dev_pm_ops lpuart_pm_ops = {
3033-
SET_RUNTIME_PM_OPS(lpuart_runtime_suspend,
3033+
RUNTIME_PM_OPS(lpuart_runtime_suspend,
30343034
lpuart_runtime_resume, NULL)
3035-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(lpuart_suspend_noirq,
3035+
NOIRQ_SYSTEM_SLEEP_PM_OPS(lpuart_suspend_noirq,
30363036
lpuart_resume_noirq)
3037-
SET_SYSTEM_SLEEP_PM_OPS(lpuart_suspend, lpuart_resume)
3037+
SYSTEM_SLEEP_PM_OPS(lpuart_suspend, lpuart_resume)
30383038
};
30393039

30403040
static struct platform_driver lpuart_driver = {
@@ -3043,7 +3043,7 @@ static struct platform_driver lpuart_driver = {
30433043
.driver = {
30443044
.name = "fsl-lpuart",
30453045
.of_match_table = lpuart_dt_ids,
3046-
.pm = &lpuart_pm_ops,
3046+
.pm = pm_ptr(&lpuart_pm_ops),
30473047
},
30483048
};
30493049

0 commit comments

Comments
 (0)