Commit bf56c751 authored by Mike Rapoport's avatar Mike Rapoport Committed by Eric Miao

[ARM] pxa: update pxa serial driver to use 'struct dev_pm_ops'

Signed-off-by: default avatarMike Rapoport <mike@compulab.co.il>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 43ddc006
...@@ -726,9 +726,10 @@ static struct uart_driver serial_pxa_reg = { ...@@ -726,9 +726,10 @@ static struct uart_driver serial_pxa_reg = {
.cons = PXA_CONSOLE, .cons = PXA_CONSOLE,
}; };
static int serial_pxa_suspend(struct platform_device *dev, pm_message_t state) #ifdef CONFIG_PM
static int serial_pxa_suspend(struct device *dev)
{ {
struct uart_pxa_port *sport = platform_get_drvdata(dev); struct uart_pxa_port *sport = dev_get_drvdata(dev);
if (sport) if (sport)
uart_suspend_port(&serial_pxa_reg, &sport->port); uart_suspend_port(&serial_pxa_reg, &sport->port);
...@@ -736,9 +737,9 @@ static int serial_pxa_suspend(struct platform_device *dev, pm_message_t state) ...@@ -736,9 +737,9 @@ static int serial_pxa_suspend(struct platform_device *dev, pm_message_t state)
return 0; return 0;
} }
static int serial_pxa_resume(struct platform_device *dev) static int serial_pxa_resume(struct device *dev)
{ {
struct uart_pxa_port *sport = platform_get_drvdata(dev); struct uart_pxa_port *sport = dev_get_drvdata(dev);
if (sport) if (sport)
uart_resume_port(&serial_pxa_reg, &sport->port); uart_resume_port(&serial_pxa_reg, &sport->port);
...@@ -746,6 +747,12 @@ static int serial_pxa_resume(struct platform_device *dev) ...@@ -746,6 +747,12 @@ static int serial_pxa_resume(struct platform_device *dev)
return 0; return 0;
} }
static struct dev_pm_ops serial_pxa_pm_ops = {
.suspend = serial_pxa_suspend,
.resume = serial_pxa_resume,
};
#endif
static int serial_pxa_probe(struct platform_device *dev) static int serial_pxa_probe(struct platform_device *dev)
{ {
struct uart_pxa_port *sport; struct uart_pxa_port *sport;
...@@ -825,11 +832,12 @@ static struct platform_driver serial_pxa_driver = { ...@@ -825,11 +832,12 @@ static struct platform_driver serial_pxa_driver = {
.probe = serial_pxa_probe, .probe = serial_pxa_probe,
.remove = serial_pxa_remove, .remove = serial_pxa_remove,
.suspend = serial_pxa_suspend,
.resume = serial_pxa_resume,
.driver = { .driver = {
.name = "pxa2xx-uart", .name = "pxa2xx-uart",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &serial_pxa_pm_ops,
#endif
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment