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

Commit c2ee91bd authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Greg Kroah-Hartman
Browse files

tty: mrst_max3110: Use dev_pm_ops



Use dev_pm_ops instead of the deprecated legacy suspend/resume for the
mrst_max3110 driver.

Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b7df719d
Loading
Loading
Loading
Loading
+12 −7
Original line number Original line Diff line number Diff line
@@ -743,9 +743,10 @@ static struct uart_driver serial_m3110_reg = {
	.cons		= &serial_m3110_console,
	.cons		= &serial_m3110_console,
};
};


#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int serial_m3110_suspend(struct spi_device *spi, pm_message_t state)
static int serial_m3110_suspend(struct device *dev)
{
{
	struct spi_device *spi = to_spi_device(dev);
	struct uart_max3110 *max = spi_get_drvdata(spi);
	struct uart_max3110 *max = spi_get_drvdata(spi);


	disable_irq(max->irq);
	disable_irq(max->irq);
@@ -754,8 +755,9 @@ static int serial_m3110_suspend(struct spi_device *spi, pm_message_t state)
	return 0;
	return 0;
}
}


static int serial_m3110_resume(struct spi_device *spi)
static int serial_m3110_resume(struct device *dev)
{
{
	struct spi_device *spi = to_spi_device(dev);
	struct uart_max3110 *max = spi_get_drvdata(spi);
	struct uart_max3110 *max = spi_get_drvdata(spi);


	max3110_out(max, max->cur_conf);
	max3110_out(max, max->cur_conf);
@@ -763,9 +765,13 @@ static int serial_m3110_resume(struct spi_device *spi)
	enable_irq(max->irq);
	enable_irq(max->irq);
	return 0;
	return 0;
}
}

static SIMPLE_DEV_PM_OPS(serial_m3110_pm_ops, serial_m3110_suspend,
			serial_m3110_resume);
#define SERIAL_M3110_PM_OPS (&serial_m3110_pm_ops)

#else
#else
#define serial_m3110_suspend	NULL
#define SERIAL_M3110_PM_OPS NULL
#define serial_m3110_resume	NULL
#endif
#endif


static int serial_m3110_probe(struct spi_device *spi)
static int serial_m3110_probe(struct spi_device *spi)
@@ -872,11 +878,10 @@ static struct spi_driver uart_max3110_driver = {
	.driver = {
	.driver = {
			.name	= "spi_max3111",
			.name	= "spi_max3111",
			.owner	= THIS_MODULE,
			.owner	= THIS_MODULE,
			.pm	= SERIAL_M3110_PM_OPS,
	},
	},
	.probe		= serial_m3110_probe,
	.probe		= serial_m3110_probe,
	.remove		= serial_m3110_remove,
	.remove		= serial_m3110_remove,
	.suspend	= serial_m3110_suspend,
	.resume		= serial_m3110_resume,
};
};


static int __init serial_m3110_init(void)
static int __init serial_m3110_init(void)