tty: max3100: Use dev_pm_ops
Use dev_pm_ops instead of the deprecated legacy suspend/resume for the max3100 driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0b2588cadf
commit
c47ddc26db
@@ -849,11 +849,11 @@ static int max3100_remove(struct spi_device *spi)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
|
||||||
static int max3100_suspend(struct spi_device *spi, pm_message_t state)
|
static int max3100_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct max3100_port *s = dev_get_drvdata(&spi->dev);
|
struct max3100_port *s = dev_get_drvdata(dev);
|
||||||
|
|
||||||
dev_dbg(&s->spi->dev, "%s\n", __func__);
|
dev_dbg(&s->spi->dev, "%s\n", __func__);
|
||||||
|
|
||||||
@@ -874,9 +874,9 @@ static int max3100_suspend(struct spi_device *spi, pm_message_t state)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int max3100_resume(struct spi_device *spi)
|
static int max3100_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct max3100_port *s = dev_get_drvdata(&spi->dev);
|
struct max3100_port *s = dev_get_drvdata(dev);
|
||||||
|
|
||||||
dev_dbg(&s->spi->dev, "%s\n", __func__);
|
dev_dbg(&s->spi->dev, "%s\n", __func__);
|
||||||
|
|
||||||
@@ -894,21 +894,21 @@ static int max3100_resume(struct spi_device *spi)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(max3100_pm_ops, max3100_suspend, max3100_resume);
|
||||||
|
#define MAX3100_PM_OPS (&max3100_pm_ops)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define max3100_suspend NULL
|
#define MAX3100_PM_OPS NULL
|
||||||
#define max3100_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct spi_driver max3100_driver = {
|
static struct spi_driver max3100_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "max3100",
|
.name = "max3100",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.pm = MAX3100_PM_OPS,
|
||||||
},
|
},
|
||||||
|
|
||||||
.probe = max3100_probe,
|
.probe = max3100_probe,
|
||||||
.remove = max3100_remove,
|
.remove = max3100_remove,
|
||||||
.suspend = max3100_suspend,
|
|
||||||
.resume = max3100_resume,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module_spi_driver(max3100_driver);
|
module_spi_driver(max3100_driver);
|
||||||
|
|||||||
Reference in New Issue
Block a user