Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0ce850d authored by Ulf Hansson's avatar Ulf Hansson Committed by Greg Kroah-Hartman
Browse files

serial: pl011: Convert to modern PM ops



Convert to modern PM ops and use the SIMPLE_DEV_PM_OPS macro to set up
the PM callbacks.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfabf7ff
Loading
Loading
Loading
Loading
+8 −9
Original line number Original line Diff line number Diff line
@@ -2167,10 +2167,10 @@ static int pl011_remove(struct amba_device *dev)
	return 0;
	return 0;
}
}


#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int pl011_suspend(struct amba_device *dev, pm_message_t state)
static int pl011_suspend(struct device *dev)
{
{
	struct uart_amba_port *uap = amba_get_drvdata(dev);
	struct uart_amba_port *uap = dev_get_drvdata(dev);


	if (!uap)
	if (!uap)
		return -EINVAL;
		return -EINVAL;
@@ -2178,9 +2178,9 @@ static int pl011_suspend(struct amba_device *dev, pm_message_t state)
	return uart_suspend_port(&amba_reg, &uap->port);
	return uart_suspend_port(&amba_reg, &uap->port);
}
}


static int pl011_resume(struct amba_device *dev)
static int pl011_resume(struct device *dev)
{
{
	struct uart_amba_port *uap = amba_get_drvdata(dev);
	struct uart_amba_port *uap = dev_get_drvdata(dev);


	if (!uap)
	if (!uap)
		return -EINVAL;
		return -EINVAL;
@@ -2189,6 +2189,8 @@ static int pl011_resume(struct amba_device *dev)
}
}
#endif
#endif


static SIMPLE_DEV_PM_OPS(pl011_dev_pm_ops, pl011_suspend, pl011_resume);

static struct amba_id pl011_ids[] = {
static struct amba_id pl011_ids[] = {
	{
	{
		.id	= 0x00041011,
		.id	= 0x00041011,
@@ -2208,14 +2210,11 @@ MODULE_DEVICE_TABLE(amba, pl011_ids);
static struct amba_driver pl011_driver = {
static struct amba_driver pl011_driver = {
	.drv = {
	.drv = {
		.name	= "uart-pl011",
		.name	= "uart-pl011",
		.pm	= &pl011_dev_pm_ops,
	},
	},
	.id_table	= pl011_ids,
	.id_table	= pl011_ids,
	.probe		= pl011_probe,
	.probe		= pl011_probe,
	.remove		= pl011_remove,
	.remove		= pl011_remove,
#ifdef CONFIG_PM
	.suspend	= pl011_suspend,
	.resume		= pl011_resume,
#endif
};
};


static int __init pl011_init(void)
static int __init pl011_init(void)